<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>RASP安全技术</title>
    <link>https://wechat2rss.xlab.app/feed/697d59809497086c9137cc5b21feed775c3455a5.xml</link>
    <description>官网：https://www.jrasp.com&#xA;(wechat feed made by @ttttmr https://wechat2rss.xlab.app)</description>
    <managingEditor> (RASP安全技术)</managingEditor>
    <image>
      <url>https://wx.qlogo.cn/mmhead/Q3auHgzwzM4XWGfiblEyWnnUTFdicvzuyz8AAUd5JHUPlC5kBu0Nt7rw/0</url>
      <title>RASP安全技术</title>
      <link>https://wechat2rss.xlab.app/feed/697d59809497086c9137cc5b21feed775c3455a5.xml</link>
    </image>
    <item>
      <title>JRASP反射加固实践</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484706&amp;idx=1&amp;sn=b2acdb47cf53aac1331a27aea63e8c8b</link>
      <description></description>
      <content:encoded><![CDATA[<p>
<span>Hsin Tsao</span> <span>2024-03-31 22:39</span> <span style="display: inline-block;">上海</span>
</p>

<p></p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=639b9978&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXm81EtOZjcmQUy2iajSXSAYS263XN1vdFO59MojDEZ4CsUhvbNyiaBS7w%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">JRASP十分重视自身安全性的建设，采用了多种方式提高RASP自身的安全防护能力，包括：</p><ul style="letter-spacing: normal;text-align: start;white-space: normal;padding-left: 30px;list-style: square;color: rgb(80, 97, 109);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;margin-top: 6px !important;" class="list-paddingleft-1"><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 2em;visibility: visible;font-size: 16px !important;"><span style="line-height: 2em;visibility: visible;">策略配置加密；</span></span></p></li><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 2em;visibility: visible;font-size: 16px !important;"><span style="line-height: 2em;visibility: visible;">RASP自身代码与业务隔离；</span></span></p></li><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 2em;visibility: visible;font-size: 16px !important;"><span style="line-height: 2em;visibility: visible;">安全策略模块磁盘加密、运行时解密；</span></span></p></li><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 2em;visibility: visible;font-size: 16px !important;"><span style="line-height: 2em;visibility: visible;">Agent与Daemon的socket通讯加密；</span></span></p></li></ul><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">作为开源项目，如果熟悉JRASP的初始化和关闭流程，将存在一类重要的绕过方式： 调用RASP的关闭或者卸载开关。 具体可以参考下面的文章：</p><blockquote style="letter-spacing: normal;text-align: start;white-space: normal;margin-bottom: 1.2em;padding: 15px 15px 15px 1rem;color: rgb(129, 145, 152);border-left-width: 6px;border-left-color: rgb(96, 125, 139);font-size: 14px;line-height: 22px;background-color: rgb(242, 247, 251);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><p style="line-height: 2em;visibility: visible;color: rgb(74, 74, 74);">RASP的安全攻防研究实践 https://www.cnblogs.com/wh4am1/p/16780056.html</p></blockquote><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">本文主要介绍下JRASP如何防止关键方法被反射调用。 先来看下JDK 的反射机制。</p><h2 style="letter-spacing: normal;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(0, 179, 138);line-height: 1.35;font-size: 18px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace !important;text-align: center !important;">1. JDK代码中的反射与限制</h2><h3 style="letter-spacing: normal;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(0, 179, 138);line-height: 1.35;font-size: 17px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace !important;text-align: center !important;">1.1 反射Demo</h3><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">一般的我们可以通过调用class对象的 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">getDeclaredMethods</span></code>来获取该类的所有的方法（包含私有方法）。 下面的代码定义了一个Foo类和私有的bar方法，并使用反射获取bar方法。</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> java.lang.reflect.Method;</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">public</span> <span class="code-snippet__class"><span class="code-snippet__keyword">class</span> <span class="code-snippet__title">Foo</span> </span>{</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__function"><span class="code-snippet__keyword">private</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">bar</span><span class="code-snippet__params">()</span> </span>{</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__function"><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">static</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">main</span><span class="code-snippet__params">(String[] args)</span> <span class="code-snippet__keyword">throws</span> Exception </span>{</span></code><code><span class="code-snippet_outer">        Method method = Foo.class.getDeclaredMethod(<span class="code-snippet__string">&#34;bar&#34;</span>);</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">if</span> (method != <span class="code-snippet__keyword">null</span>) {</span></code><code><span class="code-snippet_outer">            System.out.println(method.getName());</span></code><code><span class="code-snippet_outer">        }</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">}</span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">// 代码输出：bar</span></span></code></pre><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="caret-color: rgb(74, 74, 74);color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: normal;orphans: 2;text-align: start;widows: 2;">如果给类Foo中加上如下的静态代码:</span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="swift"><code><span class="code-snippet_outer"><span class="code-snippet__keyword">static</span> {</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__type">Reflection</span>.registerMethodsToFilter(<span class="code-snippet__type">Foo</span>.<span class="code-snippet__keyword">class</span>, <span class="code-snippet__string">&#34;bar&#34;</span>);</span></code><code><span class="code-snippet_outer"> }</span></code></pre><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="font-size: var(--articleFontsize);">再次运行main，输出如下：</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001047" data-ratio="0.17777777777777778" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=1be082d7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXPzg3CBTKjNvJU3KZaZRiatgZ9ZeebeEkT2c5HSF2OUdxusHPRtmr2Gg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">加上静态代码块之后，方法执行抛出了 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">java</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">lang</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">NoSuchMethodException</span></code></p><h3 style="letter-spacing: normal;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(0, 179, 138);line-height: 1.35;font-size: 17px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace !important;text-align: center !important;">1.2 反射源码解析</h3><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">在JDK中，对于一些执行权限较高的类如 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">sun</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">misc</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">Unsafe</span></code>，其中的 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">getUnsafe</span></code>方法也是无法通过反射获取。 原因是 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">sun</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">misc</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">Unsafe</span></code>的静态块中也有这么一行代码:</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer"><span class="code-snippet__keyword">static</span> {</span></code><code><span class="code-snippet_outer">    Reflection.registerMethodsToFilter(Unsafe.class, <span class="code-snippet__keyword">new</span> <span class="code-snippet__built_in">String</span>[]{<span class="code-snippet__string">&#34;getUnsafe&#34;</span>});</span></code><code><span class="code-snippet_outer">}</span></code></pre><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="font-size: var(--articleFontsize);">这个方法的作用通过方法名就可以看出来了: </span><code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">注册方法到过滤器</span></code><span style="font-size: var(--articleFontsize);">。这个方法需要传两个参数,第一指明要过滤的Class对象, 第二个是个String数组，里面放要过滤掉的方法名称。</span><br/></p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">Reflection在sun.reflect包下,该类维护了两个Map:</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">private <span class="code-snippet__keyword">static</span> volatile <span class="code-snippet__built_in">Map</span>&lt;Class&lt;?&gt;, <span class="code-snippet__built_in">String</span>[]&gt; fieldFilterMap;</span></code><code><span class="code-snippet_outer">private <span class="code-snippet__keyword">static</span> volatile <span class="code-snippet__built_in">Map</span>&lt;Class&lt;?&gt;, <span class="code-snippet__built_in">String</span>[]&gt; methodFilterMap;</span></code></pre><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="font-size: var(--articleFontsize);">以Class对象作为key值，一个保存需要过滤的属性名数组，一个保存需要过滤的方法名数组。 从上面的方法名称可以知道，在获取反射方法或者字段时，JVM根据class对象注册的方法或者字段的过滤器，将指定方法或者字段进行了排除。</span><br/><span style="font-size: var(--articleFontsize);"></span></p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">下面重点分析下整个过滤的过程：</p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">getDeclaredMethod</span></code>源码如下， <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">searchMethods</span></code>使用类名称和参数列表从方法列表中查找出指定的方法。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001048" data-ratio="0.24382716049382716" data-s="300,640" style="" data-type="png" data-w="972" src="https://wechat2rss.xlab.app/img-proxy/?k=9e72cd27&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXYveRoq9FJHkicYKia9bEeaiaWxSxu0Emiacolmu4kseEnSHGRUcxJxdRiaQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: normal;orphans: 2;text-align: start;widows: 2;font-size: var(--articleFontsize);">查找方法的范围来源于 </span><code style="letter-spacing: normal;orphans: 2;text-align: start;widows: 2;background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">privateGetDeclaredMethods</span></code><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: normal;orphans: 2;text-align: start;widows: 2;font-size: var(--articleFontsize);">方法返回值，其源码如下：</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001049" data-ratio="0.5992736077481841" data-s="300,640" style="" data-type="png" data-w="826" src="https://wechat2rss.xlab.app/img-proxy/?k=ecea0665&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXvBUTQaeB6GlkiaGh1k4x2lmPOhUkopc7aOVeeZjZsC1ic9E4LXsqY3icQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="font-size: var(--articleFontsize);">1处：为方法的缓存，如果已经有缓存，直接返回方法列表；</span></p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="font-size: var(--articleFontsize);">2处：如果方法的缓存为null，从JVM中获取全部的方法，并对方法进行过滤，然后将过滤的结果设置为缓存。</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001051" data-ratio="0.09814814814814815" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=854e7c76&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXGlqDbSf1L0cicmA2mAS0ZUKkJDpFa9M3ribMCpl9q5M40FA6ILCqDx5Q%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: normal;orphans: 2;text-align: start;widows: 2;font-size: var(--articleFontsize);">过滤使用了Reflection的静态字段 </span><code style="letter-spacing: normal;orphans: 2;text-align: start;widows: 2;background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">methodFilterMap</span></code><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: normal;orphans: 2;text-align: start;widows: 2;font-size: var(--articleFontsize);">，该字段的定义如下：</span><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001052" data-ratio="0.37604456824512533" data-s="300,640" style="orphans: 2;widows: 2;font-size: var(--articleFontsize);text-align: center;letter-spacing: 0.034em;" data-type="png" data-w="718" src="https://wechat2rss.xlab.app/img-proxy/?k=e3766faf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXGiaC5XpU6AfPZYSyXdqOCPy0OdJjcWd1GnYNyzXq2dSL7AhxBRX6qRg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><h3 style="letter-spacing: normal;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(0, 179, 138);line-height: 1.35;font-size: 17px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace !important;text-align: center !important;">1.3 一般应用</h3><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">JVM提供了禁止反射指定类的方法和字段的功能，对于RASP中的关键方法字段(如关闭、初始化和状态控制等)，我们可以将其设置为禁止反射：</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001053" data-ratio="0.5433300876338851" data-s="300,640" style="" data-type="png" data-w="1027" src="https://wechat2rss.xlab.app/img-proxy/?k=eba59e1b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXmYMNFPeoqIuCCcZ6h0sEfQqQxKxzCEHHUj6MISFap8CkbeUx9E9wHA%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><h2 style="letter-spacing: normal;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(0, 179, 138);line-height: 1.35;font-size: 18px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace !important;text-align: center !important;">2. 方法调用者鉴权</h2><h3 style="letter-spacing: normal;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(0, 179, 138);line-height: 1.35;font-size: 17px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace !important;text-align: center !important;">2.1 @CallerSensitive</h3><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">还有一类场景能够绕过 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">禁止方法直接反射</span></code>，即反射调用其他方法，该方法能够调用关闭的方法，即：</p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">恶意方法--(反射调用)--&gt; 方法A--(直接调用)--&gt; 关键方法B</p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">从而达到任意调用关键方法的目的，JVM 提供了注解 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">@CallerSensitive</span></code>来解决反射层次问题，但是该方案存在一些限制, <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">@CallerSensitive</span></code> 需要配合 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">Reflection</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">getCallerClass</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">()</span></code> 来使用，而调用 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);font-size: 16px;line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">getCallerClass</span></code>的类不能是自定义类加载加载的类。</p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">JRASP核心逻辑全部由自定义加载器加载，@CallerSensitive注解方案不可行。</p><h3 style="letter-spacing: normal;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(0, 179, 138);line-height: 1.35;font-size: 17px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace !important;text-align: center !important;">2.2 调用栈特征识别</h3><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">JRASP对于自定义加载器加载的类中的关键方法都采用了栈特征校验：</p><ul style="letter-spacing: normal;text-align: start;white-space: normal;padding-left: 30px;list-style: square;color: rgb(80, 97, 109);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;margin-top: 6px !important;" class="list-paddingleft-1"><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 2em;visibility: visible;font-size: 16px !important;"><span style="line-height: 2em;visibility: visible;">检查调用栈是否存在反射，即栈特征是否存在 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;line-height: 2em;visibility: visible;">java</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;line-height: 2em;visibility: visible;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;line-height: 2em;visibility: visible;">lang</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;line-height: 2em;visibility: visible;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;line-height: 2em;visibility: visible;">reflect</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;line-height: 2em;visibility: visible;">.</span></code>等相关特征</span></span></p></li><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 2em;visibility: visible;font-size: 16px !important;"><span style="line-height: 2em;visibility: visible;">调用来源是否为指定的类。如下所示给出一个例子：</span></span></p></li></ul><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001054" data-ratio="0.34543325526932084" data-s="300,640" style="" data-type="png" data-w="854" src="https://wechat2rss.xlab.app/img-proxy/?k=e58c92a0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXRFU7h1MbibWgeCibiaDSCngq6nNfbOZ7kyIa7p3LhibwtxKI9w5ZIZwgpQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">并将caller 定义为不可变常量. </p><p><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001055" data-ratio="0.31007751937984496" data-s="300,640" style="text-align: center;font-size: var(--articleFontsize);letter-spacing: 0.034em;" data-type="png" data-w="903" src="https://wechat2rss.xlab.app/img-proxy/?k=ba06872d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPaSLTm6pDTBzEpznLGfbiaXlAibytglrWZ1kFzibfBKN62jPBP8lqIia80TqTjnDIqPhAoou5JepaCVQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><h2 style="letter-spacing: normal;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(0, 179, 138);line-height: 1.35;font-size: 18px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace !important;text-align: center !important;">3. 总结</h2><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">本文给出了RASP关键方法的保护方案，使用JVM提供的过滤器来禁止直接反射调用， 对于间接反射调用的来源和栈特征做了校验， 提升RASP自身安全防护水平。</p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">-----------------------------------------------------------------</p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">官方网站：<span style="color: rgb(255, 0, 0);">https://www.jrasp.com </span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span></p><p style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 15px;margin-bottom: 15px;line-height: 2em;visibility: visible;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">github:  <span style="color: rgb(255, 0, 0);">https://github.com/jvm-rasp/jrasp-agent.git</span></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://www.jrasp.com/guide/technology/reflect.html">阅读原文</a></p>
]]></content:encoded>
      <pubDate>Sun, 31 Mar 2024 22:39:41 +0800</pubDate>
    </item>
    <item>
      <title>JRASP内存泄漏检测与清除实践</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484693&amp;idx=1&amp;sn=d20162cc9237788b8b087bbf1563c449</link>
      <description>热加载与卸载已经成为RASP的标配，而涉及到插件或者脚本的卸载问题，却少有技术文档提及， 主要原因是RASP开</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2024-03-23 18:51</span> <span style="display: inline-block;">上海</span>
</p>

<p>热加载与卸载已经成为RASP的标配，而涉及到插件或者脚本的卸载问题，却少有技术文档提及， 主要原因是RASP开</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=fda71dbe&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkUqTdIeSDIddBzStpkoVjFza9z2BI8zhibVARm1EG65gb9vwWhTe84tQ%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">热加载与卸载已经成为RASP的标配，而涉及到插件或者脚本的卸载问题，却少有技术文档提及， 主要原因是RASP开发人员更多的偏向安全，即使是经验丰富的Java工程师，遇到内存泄露问题，也会感到棘手。</p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">类卸载的条件十分苛刻，要同时满足下面的三个条件：</p><ul style="letter-spacing: normal;text-align: start;white-space: normal;padding-left: 30px;list-style: square;color: rgb(80, 97, 109);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;margin-top: 6px !important;" class="list-paddingleft-1"><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 22px;font-size: 14px !important;"><span style="line-height: 22px;">类所有的实例对象已经被回收;</span></span></p></li><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 22px;font-size: 14px !important;"><span style="line-height: 22px;">加载该类的Classloder已经被回收;</span></span></p></li><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 22px;font-size: 14px !important;"><span style="line-height: 22px;">该类对应的java.lang.Class对象没有任何对方被引用;</span></span></p></li></ul><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">一般的，无需关心class对象的引用关系，但是有些场景（如反射场景）会缓存类的Class对象，使得class对象的引用存在，导致JRASP无法卸载。</p><h2 style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(15 23 42/var(--tw-bg-opacity));line-height: 1.35;font-size: 18px;">2. 类加载器置空</h2><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">以JDK8为例子，Java虚拟机自带的类加载器有BootstrapClassLoader、ExtensionClassLoader和SystemClassLoader， 这些类加载器在JVM整个生命周期中都不会被置为空，因此它们加载的类也不会被卸载。</p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">而用户自定义的类加载器，可以在使用完成之后将加载器的对象置空，从而满足类卸载的三个条件之一。</p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">以JRASP代码为例子，执行卸载关闭操作之后，将自定义类加载器置空。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001032" data-ratio="0.2935185185185185" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=fc9485f4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkV2kW6We5iaAqa0VuNHfj8gLw4qdxFdFcianIW5DicafKP3Lia94HtBfSOQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">如果自定义类加载器没有正确的置空，JRASP将不会被完全的清理，从而引发内存泄漏。 现在我们做一个测试，将上面代码截图的第90行的 </span><code style="font-size: 16px;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">raspClassLoader</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">=</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;"></span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">null</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">;</span></code><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">注释掉（即类加载器不置空)</span><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;orphans: 2;text-align: start;widows: 2;">。</span><br/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001033" data-ratio="0.3055555555555556" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=bafe4c5f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkajfU8IYc31f7S8nmCUY2ARakgpwwqN1iagm4O71qFdJibRUKiby3RdwUg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">打包编译后加载JRASP后再执行卸载操作，主动Full GC </span><code style="font-size: 16px;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">jmap</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">-</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">histo</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">:</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">live</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">50730</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;"></span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">|</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">grep com</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">jrasp</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">agent</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">core</span></code><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">，结果如下所示：</span><br/></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="http"><code><span class="code-snippet_outer"> <span class="code-snippet__attribute">206</span>:            50           3200  com.jrasp.agent.core.log.LogRecord</span></code><code><span class="code-snippet_outer"> <span class="code-snippet__attribute">307</span>:            12           1344  com.jrasp.agent.core.classloader.ModuleJarClassLoader</span></code><code><span class="code-snippet_outer"> <span class="code-snippet__attribute">460</span>:            12            480  com.jrasp.agent.core.module.CoreModule</span></code><code><span class="code-snippet_outer"> <span class="code-snippet__attribute">542</span>:            12            288  [Lcom.jrasp.agent.core.classloader.RoutingURLClassLoader$Routing;</span></code><code><span class="code-snippet_outer"> <span class="code-snippet__attribute">548</span>:            12            288  com.jrasp.agent.core.classloader.RoutingURLClassLoader$Routing</span></code><code><span class="code-snippet_outer"> // 其他类省略...</span></code></pre><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">在Full GC之后，JRASP实例个数不为空，存在内存泄漏。使用性能诊断（jprofile，eclipse的MAT工具也是可以）工具，查看JRASP的对象：</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001034" data-ratio="0.5287037037037037" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=cd490c73&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2Gxibwkjkks3liblrZVicRpOYRzUGEFTics1EXoWpTLPvicWuYJu05Fy3FNicVBL73EdQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">查看其中一个对象的引用关系，如下所示：</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001035" data-ratio="0.5472222222222223" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=cfeb9eb4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkyJcCQjRicCFnrFBhUMGKiaSG7fLiaq4NbOru1UficpQ89NCyzTgUGN2t2A%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">从上图的引用关系可以明显看出，存在一条引用链路，链路从 </span><code style="font-size: 16px;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">RaspClassloader</span></code><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">开始指向 </span><code style="font-size: 16px;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">LogRecord</span></code><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;"> （上图中两个红色圈的之间的灰色线） (黄色为class对象，红色为GC Roots)</span><br/></p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">内存泄漏的原因：<strong><span style="color: rgb(255, 0, 0);">classloader没有置为空，导致内存泄漏</span></strong>。</p><h2 style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(15 23 42/var(--tw-bg-opacity));line-height: 1.35;font-size: 18px;">3. 对象置空和资源关闭</h2><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">以JRASP为例说明，这里包括线程池关闭、自定义线程、定时器停止、shutdownHook移除、ClassFileTransformer移除和threadlocal线程变量清除等.</p><h3 style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(15 23 42/var(--tw-bg-opacity));line-height: 1.35;font-size: 18px;"><span style="font-size: 16px;">3.1 定时器停止</span></h3><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">完全停止 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">java</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">lang</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">timer</span></code>，需要将定时器线程停止，并将任务执行队列清空。</p><h3 style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(15 23 42/var(--tw-bg-opacity));line-height: 1.35;font-size: 18px;"><span style="font-size: 16px;">3.2 shutdownHook移除</span></h3><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">在Java进程关闭之前，能够即时的清理rasp占用的磁盘等资源，shutdownHook可以执行指定的操作。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001036" data-ratio="0.3388888888888889" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=6e5aa8b7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkEQticDrZp71RxmfvRSf22ic6cicqOESSAgOAItOZb8xV72POwqfH3aE9Q%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">如果主动关闭rasp，没有清理shutdownHook，将会导致内存泄漏。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001037" data-ratio="0.6916666666666667" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=0148c3c4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkM7AUB90XrD5kbCUvm3ln7sicoKSccjnS2biaCsicx54q0lzlxKsiaXh6Bw%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="color: rgb(15 23 42/var(--tw-bg-opacity));font-family: Menlo, Monaco, &#34;Source Code Pro&#34;, Consolas, Inconsolata, &#34;Ubuntu Mono&#34;, &#34;DejaVu Sans Mono&#34;, &#34;Courier New&#34;, &#34;Droid Sans Mono&#34;, &#34;Hiragino Sans GB&#34;, 微软雅黑, monospace;font-weight: 700;letter-spacing: normal;orphans: 2;text-align: start;widows: 2;font-size: 16px;">3.3 线程池关闭</span><br/></p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">如果RASP使用到了线程池，在卸载时需要关闭。即使关闭了线程池，由于jvm线程池重写了 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">finalize</span></code>方法，一次FullGC依然无法清除残留的对象。 JRASP 1.2.x(商业版本) 已经把线程池替换为多个 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">java</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">lang</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">timer</span></code>，卸载时非常清爽干净。</p><h3 style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(15 23 42/var(--tw-bg-opacity));line-height: 1.35;font-size: 18px;"><span style="font-size: 16px;">3.4 线程变量的清除</span></h3><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">在JRASP中，使用线程变量threadlocal关联请求上下文与具体的hook类，来辅助检测功能。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001038" data-ratio="0.1930835734870317" data-s="300,640" data-type="png" data-w="1041" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=218f61ec&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkktkSwQVHAnYCtCTUkRRO3Uz5l2JnJXMLjyHS25HfWzU5We8bmciaPiasg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">在RASP卸载时，需要将线程thread中缓存的threadlocal对象。</p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">在介绍JRASP实现方案之前，先来看下tomcat是如何实现热卸载的和内存泄漏检测的。</p><h4 style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(15 23 42/var(--tw-bg-opacity));line-height: 1.35;font-size: 18px;"><span style="font-size: 15px;">3.4.1 tomcat资源清除与内存泄漏检测</span></h4><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">tomcat在卸载war包时，调用war的类加载器 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">WebappClassLoaderBase</span></code>对象的stop方法完成资源的关闭与清理操作。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001039" data-ratio="0.6832779623477298" data-s="300,640" data-type="png" data-w="903" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=474eacf6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkfmwlKcFnEH3P9vNworhKrVvop2rfqnmFTV5ibOZQJNMzeuS7GRtEn9g%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">具体的引用清除实现来在 </span><code style="font-size: 16px;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">clearReferences</span></code><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">中，主要有：注销JDBC驱动、关闭应用创建的线程、检查线程变量的内存泄漏等，关闭连接和线程的操作容易实现，本节主要针对线程变量的内存泄漏清理与检测。</span><br/></p><ul style="letter-spacing: normal;text-align: start;white-space: normal;padding-left: 30px;list-style: square;color: rgb(80, 97, 109);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;margin-top: 6px !important;" class="list-paddingleft-1"><li style="margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);line-height: 22px;font-size: 14px !important;"><span style="line-height: 22px;">线程变量泄漏检测</span></span></p></li></ul><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">在线程Thread对象中使用两个字段保存该线程使用的 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">threadlocal</span></code>对象：</p><pre style="letter-spacing: normal;text-align: start;padding-top: 8px;padding-bottom: 6px;background-color: rgb(29, 31, 33);border-radius: 0px;overflow-y: auto;color: rgb(80, 97, 109);font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-size: 10px;line-height: 12px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 1px solid rgb(226, 226, 226) !important;"><ol class="list-paddingleft-1" style="padding-top: 10px;padding-bottom: 10px;padding-left: 30px;list-style: none;color: rgba(0, 0, 0, 0);overflow-y: auto;"><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">public</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">class</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">Thread</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">implements</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">Runnable</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">{</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(150, 152, 150);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">/* ThreadLocal values pertaining to this thread. This map is maintained</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(150, 152, 150);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">     * by the ThreadLocal class. */</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">ThreadLocal</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">.</span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">ThreadLocalMap</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> threadLocals </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">=</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">null</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">;</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(150, 152, 150);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">/*</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(150, 152, 150);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">     * InheritableThreadLocal values pertaining to this thread. This map is</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(150, 152, 150);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">     * maintained by the InheritableThreadLocal class.</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(150, 152, 150);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">     */</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">ThreadLocal</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">.</span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">ThreadLocalMap</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> inheritableThreadLocals </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">=</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">null</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">;</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(150, 152, 150);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">// 其他代码省略...</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">}</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">   </span></code></span></span></p></li></ol></pre><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">threadLocals的类型是 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">ThreadLocalMap</span></code>，ThreadLocalMap中用数组table保存threadlocal变量的key、value。 因此最终我们需要清理的是这个table里面的Entry。</p><pre style="letter-spacing: normal;text-align: start;padding-top: 8px;padding-bottom: 6px;background-color: rgb(29, 31, 33);border-radius: 0px;overflow-y: auto;color: rgb(80, 97, 109);font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;font-size: 10px;line-height: 12px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 1px solid rgb(226, 226, 226) !important;"><ol class="list-paddingleft-1" style="padding-top: 10px;padding-bottom: 10px;padding-left: 30px;list-style: none;color: rgba(0, 0, 0, 0);overflow-y: auto;"><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">static</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">class</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">ThreadLocalMap</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">{</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">static</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">class</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">Entry</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">extends</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">WeakReference</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">&lt;</span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">ThreadLocal</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">&lt;?&gt;&gt;</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">{</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">        </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">Object</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> value</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">;</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">        </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">Entry</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">(</span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">ThreadLocal</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">&lt;?&gt;</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> k</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">,</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">Object</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> v</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">)</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">{</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">            </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">super</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">(</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">k</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">);</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">            value </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">=</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> v</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">;</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">        </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">}</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">}</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(150, 152, 150);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">// 保存threadlocal变量的key、value</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span><span style="color: rgb(178, 148, 187);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">private</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> </span><span style="color: rgb(129, 162, 190);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">Entry</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">[]</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;"> table</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">;</span></code></span></span></p></li><li style="padding-left: 1em;list-style-type: decimal;margin-top: 6px !important;"><p><span style="color: rgb(74, 74, 74);display: block;line-height: 22px;font-size: 14px !important;word-break: inherit !important;"><span style="line-height: 22px;display: block;word-break: inherit !important;"><code style="white-space: pre-wrap;margin-left: -20px;display: flex;line-height: 12px;overflow-wrap: normal;border: 0px;font-size: 10px;font-family: inherit !important;"><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">}</span><span style="color: rgb(197, 200, 198);line-height: 20px;font-size: 13px !important;white-space: inherit !important;">    </span></code></span></span></p></li></ol></pre><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">tomcat中线程变量的内存泄漏检测代码在 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">checkThreadLocalsForLeaks</span></code>中。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001044" data-ratio="0.7564814814814815" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=1c9ba92a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkdH7BhFDYh1icfLVOdINkql88PRXQiapwSICou8yD8kCXJdH5gibKVwWeg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="text-align: left;">主要是反射threadLocals、inheritableThreadLocals<br/></p><h4 style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(15 23 42/var(--tw-bg-opacity));line-height: 1.35;font-size: 18px;"><span style="font-size: 14px;">3.4.2 JRASP线程清除方案</span></h4><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">一般的在使用完线程变量之后，要及时的调用 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">threadlocal</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">remove</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">()</span></code> 将线程变量移除。 但是对于RASP来说，业务线程池线程复用机制，并且无法确定什么时候任务执行完成，也就无法在任务执行完成之后清除。</p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">JRASP采用类似于tomcat线程变量内存泄漏的检测方式，即反射调用 <code style="background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">threadlocal</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">remove</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">()</span></code>方法。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001040" data-ratio="0.5099904852521409" data-s="300,640" data-type="png" data-w="1051" style="width: 578px;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=bc248d1e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2Gxibwkjkk3lqzE0GrWbrRm1SETH4MdcofEDr5IZTKDmdt2tBmD7X67HmTVCSXJw%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">cleanThreadLocals的实现：</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001041" data-ratio="0.3990740740740741" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=877b0806&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOmicL7ia0ARZmwZ2GxibwkjkkCbXjyKHvibTQTQGcmEDqJWAsPvSibTN7ZspWUGJpqPbzdTxwg6f8BSNg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;">上面的方案存在一些限制，JDK17以上禁止了跨模块的反射，上面的反射调用执行会报错，需要业务在JVM参数中增加 </span><code style="font-size: 16px;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;background-color: rgb(243, 241, 241);color: rgb(88, 88, 88);line-height: 18px;font-family: consolas, menlo, courier, monospace, &#34;Microsoft Yahei&#34; !important;border: 0px !important;"><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">--</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">add</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">-</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">opens</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">=</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">java</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">base</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">/</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">java</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">.</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">lang</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">=</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">ALL</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">-</span><span style="display: inline-block;padding-right: 2px;padding-left: 2px;font-size: 14px;">UNNAMED</span></code><span style="color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#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;letter-spacing: normal;orphans: 2;text-align: start;white-space: pre-line;widows: 2;"> 解除限制。（增加参数成本较低，业务使用了三方包也会开启该参数）</span><br/></p><h2 style="letter-spacing: normal;text-align: start;white-space: normal;margin-top: 2rem;margin-bottom: 0.5rem;font-weight: 700;color: rgb(15 23 42/var(--tw-bg-opacity));line-height: 1.35;font-size: 18px;">4. 总结</h2><p style="font-size: 16px;letter-spacing: normal;text-align: start;margin-top: 15px;margin-bottom: 15px;white-space: pre-line;line-height: 30px;color: rgb(74, 74, 74);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">  本文介绍了JRASP卸载时的一些坑，并给出了解决方案，特别是线程池的threadlocal内存泄漏， 给出了检测和卸载代码，该方案在JRASP上使用较为成功。</p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>




]]></content:encoded>
      <pubDate>Sat, 23 Mar 2024 18:51:23 +0800</pubDate>
    </item>
    <item>
      <title>jrasp 1.2.0 版本主要特性说明</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484677&amp;idx=1&amp;sn=8551cada792f5945a054611bd4bc07b1</link>
      <description>在宿主机上启动一个tomcat docker镜像启动jrasp守护进程daemon自动发现Java进程，包括</description>
      <content:encoded><![CDATA[<p>
<span>Hsin Tsao</span> <span>2023-11-25 19:58</span> <span style="display: inline-block;">上海</span>
</p>

<p>在宿主机上启动一个tomcat docker镜像启动jrasp守护进程daemon自动发现Java进程，包括</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=f9443813&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYO6uoZkVDERSiat80Z9r6MHxEaIcVQvMP4JCEslj39kekyusvKelXa8q6yOIKaAH4mNOppgSTKCXDw%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p><span style="font-size: 15px;">在宿主机上启动一个<span style="font-size: 15px;font-family: &#34;JetBrains Mono&#34;, monospace;">tomcat docker</span>镜像</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001020" data-ratio="0.09814814814814815" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=3a4a7c5e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYO6uoZkVDERSiat80Z9r6MHxsicHkYUsdloDckCPic7mG1ZU4samEk6pFI28twYIXwibL4Ez8PljtYvmg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="font-family: Menlo-Regular, monospace;">启动</span>jrasp<span style="font-family: Menlo-Regular, monospace;">守护进程</span>daemon<span style="font-family: Menlo-Regular, monospace;">自动发现</span>Java<span style="font-family: Menlo-Regular, monospace;">进程<span style="font-family: Menlo-Regular, monospace;">，</span>包括容器中</span>Java<span style="font-family: Menlo-Regular, monospace;">进程</span><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001021" data-ratio="0.24537037037037038" data-s="300,640" style="font-size: var(--articleFontsize);letter-spacing: 0.034em;" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=1dcff795&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYO6uoZkVDERSiat80Z9r6MHx2QUgcV60iaU44swWaZ4mqmXNeaazqxibaGGib6zTbUTof8mGcy2XsmWVQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="font-family: Menlo-Regular, monospace;">容器中</span>Java<span style="font-family: Menlo-Regular, monospace;">进程</span>pid<span style="font-family: Menlo-Regular, monospace;">为</span>1<span style="font-family: Menlo-Regular, monospace;">，宿主机上进程的pid为</span>2523392<br/></p><p md-src-pos="180..188">控制台上看到进程</p><p md-src-pos="180..188"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001022" data-ratio="0.3212962962962963" data-s="300,640" style="text-align: center;font-size: var(--articleFontsize);letter-spacing: 0.034em;" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=67bb51ac&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYO6uoZkVDERSiat80Z9r6MHxoU7pdYSIUx6W8Klic06u76MEs4ICicA7HIVSbEz5glQUiblqa5CowchXw%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/><br/></p><p style="text-align: center;"><strong>特性 1：注入容器中 Java 进程</strong><span style="display: none;line-height: 0px;">‍</span></p><p>进入到进程<span style="font-family: &#34;JetBrains Mono&#34;, monospace;">/proc</span>目录，<span style="font-family: &#34;JetBrains Mono&#34;, monospace;">jrasp</span>需要的安装包已经自动安装到了容器中了（不包含<span style="font-family: &#34;JetBrains Mono&#34;, monospace;"> jrasp-daemon</span>）。</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001023" data-ratio="0.0962962962962963" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=70943b36&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYO6uoZkVDERSiat80Z9r6MHxaPYMVXSEME6C5HyHDibTU23OlNHiaLlbCmhJnmcS4kwic6NASQfIgpCog%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;">进程已经处于防护状态</span><br/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001024" data-ratio="0.3212962962962963" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=24ce46e8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYO6uoZkVDERSiat80Z9r6MHxZTZXE3AhlOTMWqyHkU3MAChTftg18HSCYAbBLv3Owet04oEynSBhtA%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="text-align: center;"><strong style="text-align: center;white-space: normal;">特性 2：日志传输使用socket</strong></p><p>1.1.x <span style="font-family: Menlo-Regular, monospace;">版本日志写入磁盘，需要借助</span>logagent<span style="font-family: Menlo-Regular, monospace;">完成日志收集和投递；</span>1.2.x <span style="font-family: Menlo-Regular, monospace;">版本不再需要安装</span>logagent<span style="font-family: Menlo-Regular, monospace;">；</span><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;">所有日志通过</span><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;font-family: &#34;JetBrains Mono&#34;, monospace;">socket</span><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;">传输到控制台，</span><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;font-family: &#34;JetBrains Mono&#34;, monospace;">agent</span><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;">或者</span><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;font-family: &#34;JetBrains Mono&#34;, monospace;">daemon</span><span style="font-size: var(--articleFontsize);letter-spacing: 0.034em;">断开连接后日志写入磁盘，重连后自动回传离线日志；</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001025" data-ratio="0.5259259259259259" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=782f1674&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYO6uoZkVDERSiat80Z9r6MHxticyPOm1xs6cC3OUORFLMogMR1O0RZsHVP3lOLGOrbNXiasStPMrDEHg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="text-align: center;"><strong style="text-align: center;white-space: normal;">特性 3：模块配置自动提取</strong><span style="font-family: Menlo-Regular, monospace;"></span></p><p>编译时通过<span style="font-family: &#34;JetBrains Mono&#34;, monospace;color: rgb(0, 82, 255);">@RaspValue</span>注解提取配置参数</p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-imgfileid="100001026" data-ratio="0.55" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=6772c7a7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYO6uoZkVDERSiat80Z9r6MHxQwvsdvqppicYsiapgg4C1RDh3Y9iaOKGapibUGI8fOJqkHtsmwmsD6cmJQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p>注：<span style="font-family: &#34;JetBrains Mono&#34;, monospace;">1.2.x </span>将是<span style="font-family: &#34;JetBrains Mono&#34;, monospace;">2024</span>年主要维护版本</p><p style="text-align: left;"><strong style="text-align: center;white-space: normal;"></strong></p><p style="text-align: left;"><strong style="text-align: center;white-space: normal;"></strong></p><p style="text-align: center;"><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://www.jrasp.com/guide/install/v1.2.0/jrasp-agent.html">阅读原文</a></p>
]]></content:encoded>
      <pubDate>Sat, 25 Nov 2023 19:58:04 +0800</pubDate>
    </item>
    <item>
      <title>JRASP在「新点软件」万级别⼤规模落地实践</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484620&amp;idx=1&amp;sn=6dd78f8dd31d32d7711ddbe21e1b257e</link>
      <description>国泰新点软件公司围绕智慧招采、智慧政务、数字建筑三大核心业务领域，为各级政府部门、大型集团企业及相关行业单位</description>
      <content:encoded><![CDATA[<p>
<span>羽音@hycsxs</span> <span>2023-10-07 12:35</span> <span style="display: inline-block;">上海</span>
</p>

<p>国泰新点软件公司围绕智慧招采、智慧政务、数字建筑三大核心业务领域，为各级政府部门、大型集团企业及相关行业单位</p>
<p></p>



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


<blockquote class="js_blockquote_wrap" data-type="2" data-url="" data-author-name="" data-content-utf8-length="92" data-source-title="https://www.epoint.com.cn/"><section class="js_blockquote_digest"><p>国泰新点软件公司围绕智慧招采、智慧政务、数字建筑三大核心业务领域，为各级政府部门、大型集团企业及相关行业单位提供从规划咨询、软件开发与智能设备研发、实施交付到持续运营维护的全方位服务。</p></section><section class="blockquote_info js_blockquote_source" data-json="%7B%22type%22%3A%22out%22%2C%22source%22%3A%22url%22%2C%22digest%22%3A%22%3Cp%3E%E5%9B%BD%E6%B3%B0%E6%96%B0%E7%82%B9%E8%BD%AF%E4%BB%B6%E5%85%AC%E5%8F%B8%E5%9B%B4%E7%BB%95%E6%99%BA%E6%85%A7%E6%8B%9B%E9%87%87%E3%80%81%E6%99%BA%E6%85%A7%E6%94%BF%E5%8A%A1%E3%80%81%E6%95%B0%E5%AD%97%E5%BB%BA%E7%AD%91%E4%B8%89%E5%A4%A7%E6%A0%B8%E5%BF%83%E4%B8%9A%E5%8A%A1%E9%A2%86%E5%9F%9F%EF%BC%8C%E4%B8%BA%E5%90%84%E7%BA%A7%E6%94%BF%E5%BA%9C%E9%83%A8%E9%97%A8%E3%80%81%E5%A4%A7%E5%9E%8B%E9%9B%86%E5%9B%A2%E4%BC%81%E4%B8%9A%E5%8F%8A%E7%9B%B8%E5%85%B3%E8%A1%8C%E4%B8%9A%E5%8D%95%E4%BD%8D%E6%8F%90%E4%BE%9B%E4%BB%8E%E8%A7%84%E5%88%92%E5%92%A8%E8%AF%A2%E3%80%81%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E4%B8%8E%E6%99%BA%E8%83%BD%E8%AE%BE%E5%A4%87%E7%A0%94%E5%8F%91%E3%80%81%E5%AE%9E%E6%96%BD%E4%BA%A4%E4%BB%98%E5%88%B0%E6%8C%81%E7%BB%AD%E8%BF%90%E8%90%A5%E7%BB%B4%E6%8A%A4%E7%9A%84%E5%85%A8%E6%96%B9%E4%BD%8D%E6%9C%8D%E5%8A%A1%E3%80%82%3C%2Fp%3E%22%2C%22digestLen%22%3A92%2C%22text%22%3A%22%22%2C%22article%22%3A%7B%7D%2C%22hasReportOverSize%22%3Atrue%2C%22editorReportData%22%3A%5B%7B%22id%22%3A%22122333%22%2C%22key%22%3A%2276%22%2C%22len%22%3A1%7D%5D%2C%22from%22%3A%22https%3A%2F%2Fwww.epoint.com.cn%2F%22%7D"><span class="blockquote_other"><a href="https://www.epoint.com.cn/" target="_blank">https://www.epoint.com.cn/</a></span></section></blockquote><p><span style="font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="mso-list:Ignore;">一、</span></span><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="font-family:宋体;">背景介绍</span></span></strong></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">⽬前开源的</span>RASP</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">产品中，有百度</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">open-rasp</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">、</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">jrasp</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">和字节</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">hids-rasp</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">等多款产品。在产品选型阶段</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">，</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">因为公司内部有不少华为</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">ARM</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">指令架构的</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">国产系统</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">，中间曾经尝试</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">编译</span><span style="font-family:Calibri;">ARM</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"> </span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">V8</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">检测引擎但</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">由于缺少源码</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">最终失败，</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">无奈</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">只能放弃；字节</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">HIDS/RASP</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">安全策略不多，偏向于</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">&#34;</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">⽇志时收集器</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">&#34;</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">，⽆法满⾜当前的⽣产环境的需求。</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">在</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">试⽤了⼀款商业</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">RASP</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">后，</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:Calibri;">“</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">机缘巧合</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:Calibri;">”</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">下找到了开源的</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">jrasp</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">，</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">于是开始安装</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">试用</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">。<br/></span></span></p><h1 style="margin-top:0.0000pt;margin-bottom:0.0000pt;text-autospace:ideograph-numeric;page-break-after:avoid;mso-pagination:lines-together;mso-outline-level:1;line-height:150%;mso-list:l0 level1 lfo1;"><span style="font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="mso-list:Ignore;">二、</span></span><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="font-family:宋体;">项目信心</span></span></strong><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"></span></strong></h1><p><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">尽管</span>JRASP</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">项⽬在</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">github</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">上</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">star</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">数量和安装量都不多，</span><span style="font-family:宋体;">但是经过与作者⼀段时间的技术交流，发现他⻓期从事</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">JavaAgent</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">开发⼯作，在性能诊断、故障演练、全链路监控等⽅⾯经验⾮常丰富，并且对同类产品如</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">btrace</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">、</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">skywalking</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">和</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">open-rasp</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">等有源码级别的理解。</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">jrasp</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">项⽬吸收了同类产品的优势，核⼼框架层的代码最早的可以追溯到</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">10</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">年前，稳定耐⽤</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;">bug</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">极少。<br/></span></span></p><h1 style="margin-top:0.0000pt;margin-bottom:0.0000pt;text-autospace:ideograph-numeric;page-break-after:avoid;mso-pagination:lines-together;mso-outline-level:1;line-height:150%;mso-list:l0 level1 lfo1;"><span style="font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="mso-list:Ignore;">三、</span></span><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="font-family:宋体;">业务特征</span></span></strong><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"></span></strong></h1><p style="margin-left:0.0000pt;mso-para-margin-left:0.0000gd;"><strong><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;">3.1</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">、</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">业务特征</span></span></strong><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;"></span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"></span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="1.1080530071355759" data-s="300,640" style="width: 458px;height: 507px;" data-type="png" data-w="981" src="https://wechat2rss.xlab.app/img-proxy/?k=0d8cbbef&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYP9pvKQcTkTJGcfua91EZfJGNPicacZZ0SgdZPziaU7kTrXUfFVLZkcaKBZvW6FtkVnQ5LLg35lEo0g%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;"></span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">公司共有</span><span style="font-family:PingFangSC-Regular;">3000多个项⽬，分布在全国各地，每个项⽬的节点数量在20～200台，总节点数量超过10万规模。每个项⽬相互隔离，要求在每个项⽬部署安全产品，所有的安全产品共⽤1台主机(RASP产品占⽤约0.5台)。<br/></span></span></p><p style="margin-left:0.0000pt;mso-para-margin-left:0.0000gd;"><strong><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;">3.2</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">、</span><span style="font-family:Calibri;">JRASP</span><span style="font-family:宋体;">的整体架构</span></span></strong><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;"></span></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;"><img class="rich_pages wxw-img" data-ratio="0.5064814814814815" data-w="1080" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=7307a7a5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYP9pvKQcTkTJGcfua91EZfJWxWJ5b7e4uuR7NybAZCJb4Y2obWBX7Y8JjxHy4JUwC82bUFibEsIibdw%2F640%3Fwx_fmt%3Dpng"/><br/><mpchecktext><br/></mpchecktext></span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">主要包含三个部分：</span>jrasp-agent<span style="font-family:宋体;">、</span><span style="font-family:Calibri;">jrasp-daemon</span><span style="font-family:宋体;">、</span><span style="font-family:Calibri;">jrasp-admin</span><span style="font-family:宋体;">；</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"></span><span style="font-family:Wingdings;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="mso-list:Ignore;"><br/></span></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">检测</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">插件模块化：每种模块解决⼀类安全漏洞，并且模块可以做到热升级；</span></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;"></span></span><strong><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;">3.3</span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">、</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;">安装部署<br/></span></span></strong></p><p><span style="font-family: 宋体;font-size: 14px;">需要准备的资源：4核8GB配置主机⼀台，⽤做管理端。</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer">管理端编译安装⽂档：</span></code><code><span class="code-snippet_outer"><span class="code-snippet__symbol">https:</span>/<span class="code-snippet__regexp">/github.com/jvm</span>-rasp/web/blob/master/README.md</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">Agent安装⽂档：</span></code><code><span class="code-snippet_outer"><span class="code-snippet__symbol">https:</span>/<span class="code-snippet__regexp">/www.jrasp.com/guide</span><span class="code-snippet__regexp">/install/v</span>1.<span class="code-snippet__number">1.3</span>/jrasp-agent.html</span></code></pre></section><p><strong><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;"><mpchecktext><br/></mpchecktext></span></span></strong><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;"></span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:normal;mso-bidi-font-weight:bold;font-size:12.0000pt;mso-font-kerning:1.0000pt;"></span></p><h1 style="margin-top:0.0000pt;margin-bottom:0.0000pt;text-autospace:ideograph-numeric;page-break-after:avoid;mso-pagination:lines-together;mso-outline-level:1;line-height:150%;mso-list:l0 level1 lfo1;"><span style="font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="mso-list:Ignore;">四、</span></span><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="font-family:宋体;">性能对比</span></span></strong><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"></span></strong></h1><p><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">在上线之前做了严格的性能测试，并且对多款产品</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">进行</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">性能</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">测试</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">，因为涉及到其他商业化产品，细节数据不便展示，可以总结为：整体性能与</span>open-rasp相当。<br/></span></p><h1 style="margin-top:0.0000pt;margin-bottom:0.0000pt;text-autospace:ideograph-numeric;page-break-after:avoid;mso-pagination:lines-together;mso-outline-level:1;line-height:150%;mso-list:l0 level1 lfo1;"><span style="font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="mso-list:Ignore;">五、</span></span><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="font-family:宋体;">主要改造</span></span></strong><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"></span></strong></h1><p><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;">一般来说RASP产品⽆法直接在企业内部使⽤，必须经过⼀定的改造以适应公司内部的⽣态环境。主要的改造有：<span style="font-family:PingFangSC-Regular;"><br/></span></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">1.兼容 windows、macos、linux（x86_64、aarch64）；<br/>2.⽀持宿主机上的docker安装运⾏；<br/>3.新增多个检测模块如内存⻢和SQL注⼊等；<br/>4.模块运⾏时解密，提⾼策略的安全性；<br/>5.管理端由Java改造为Golang，使得管理端资源占⽤少；<br/>6.复⽤jrasp的注⼊层框架，检测策略进⾏了较⼤的重写；<br/></span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">除了通⽤的功能改造外，还对</span>JRASP做了⼀些专属改造，如增加公司⾃研的登录框架的弱密码检测模块，流量解密模块等，管理端增加了内部的移动设备登录功能，简化了模块与策略的配置流程等。<br/></span></p><p><span style="font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="mso-list:Ignore;">六、<strong>安装</strong></span></span><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="font-family:宋体;">部署<br/></span></span></strong></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">总接入项目</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;">250</span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">多个，总接入应用数量</span></span><strong><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;">1</span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">w</span></span></strong><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">多个</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">，经过⻓达半年的灰度部署过程中，累计发现并修复数⼗个兼容性问题和</span>bug，产品稳定性、性能逐步稳定</span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">。</span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"></span></p><h1 style="margin-top:0.0000pt;margin-bottom:0.0000pt;text-autospace:ideograph-numeric;page-break-after:avoid;mso-pagination:lines-together;mso-outline-level:1;line-height:150%;mso-list:l0 level1 lfo1;"><span style="font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="mso-list:Ignore;">七、</span></span><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"><span style="font-family:宋体;">性能优化</span></span></strong><strong style="mso-bidi-font-weight:normal;"><span style="mso-spacerun:&#39;yes&#39;;font-family:Calibri;mso-fareast-font-family:宋体;mso-bidi-font-family:&#39;Times New Roman&#39;;line-height:150%;mso-ansi-font-weight:bold;font-size:15.0000pt;mso-font-kerning:22.0000pt;"></span></strong></h1><p><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;">jrasp框架层⾯没有性能上的瓶颈，性能主要体现在检测模块上，如新增的sql词法分析算法，初始版本导致cpu飙⾼参考:<span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"></span><span style="text-decoration:underline;"><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);text-decoration:underline;text-underline:single;font-size:10.0000pt;mso-font-kerning:0.0000pt;"><a href="https://www.jrasp.com/guide/case/case20230619/case20230619.html" target="_blank">https://www.jrasp.com/guide/case/case20230619/case20230619.html</a></span></span><span style="text-decoration:underline;"><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);text-decoration:underline;text-underline:single;font-size:10.0000pt;mso-font-kerning:0.0000pt;">；</span></span>web应⽤名称的识别上，存在bug导致守护进程cpu飙升。参考</span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;">：<span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><span style="font-family:PingFangSC-Regular;"></span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"></span><span style="text-decoration:underline;"><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);text-decoration:underline;text-underline:single;font-size:10.0000pt;mso-font-kerning:0.0000pt;"><a href="https://www.jrasp.com/guide/case/case20230902/case20230902.html" target="_blank">https://www.jrasp.com/guide/case/case20230902/case20230902.html</a></span></span></span></span><span style="text-decoration:underline;"><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);text-decoration:underline;text-underline:single;font-size:10.0000pt;mso-font-kerning:0.0000pt;"></span></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><br/></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"><br/><mpchecktext><br/></mpchecktext></span><span style="mso-spacerun:&#39;yes&#39;;font-family:PingFangSC-Regular;color:rgb(51,51,51);font-size:10.0000pt;mso-font-kerning:0.0000pt;"></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;"><br/></span></span></p><p><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><span style="font-family:宋体;"><br/></span></span><span style="mso-spacerun:&#39;yes&#39;;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:&#39;Times New Roman&#39;;font-size:10.5000pt;mso-font-kerning:1.0000pt;"></span></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247484620">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=10015714&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzg5MjQ1OTkwMg%3D%3D%26mid%3D2247484620%26idx%3D1%26sn%3D6dd78f8dd31d32d7711ddbe21e1b257e%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sat, 07 Oct 2023 12:35:00 +0800</pubDate>
    </item>
    <item>
      <title>RASP检测能力提升的思考与实践</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484614&amp;idx=1&amp;sn=8fdb169f569ebd4acbf39fbd56f8a05b</link>
      <description>这里讲讲RASP目前的防护能力与检测思路，开文先讲述整体架构，后面挑一些重点讲讲，包括其中的部分防护策略以及目前的性能情况、运营中遇到的问题。</description>
      <content:encoded><![CDATA[<p>
<span>turn1tup</span> <span>2023-09-28 12:24</span> <span style="display: inline-block;">上海</span>
</p>

<p>这里讲讲RASP目前的防护能力与检测思路，开文先讲述整体架构，后面挑一些重点讲讲，包括其中的部分防护策略以及目前的性能情况、运营中遇到的问题。</p>
<p></p>



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


<blockquote class="js_blockquote_wrap" data-type="2" data-url="" data-author-name="" data-content-utf8-length="41" data-source-title=""><section class="js_blockquote_digest"><p>许纬地，平安银河实验室安全研究员，研究方向为蓝军攻击、RASP防护、云原生等。<span style="color: rgba(0, 0, 0, 0.9);font-family: PingFangSC-light;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgba(137, 177, 230, 0.1);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;"><br/></span></p></section></blockquote><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5583333333333333" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=4f16d6e8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLjWyawXgHOo5picSash5yFjO4FT60Ixm7ibTqOgQLHOCIVI9LTdmrrn5A%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5666666666666667" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=a200a5db&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLXtVdyQhZKKOTicTBZt0LIf136QnR9g3RW9EQ76Vuiapxcsx4GBWiaDZpA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.562962962962963" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=db86594c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLKTfNlOLQicicM3tH4zhQdq2XMuzzoGN5lMr9CGhr9Vd8cojUhFesJAlQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5592592592592592" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=b421f642&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLFTht4ZlGJAaGN83zOM1jpY97NxFRr1mFAHRH2ODbKHxkdictyyWFYjg%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5675925925925925" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=0a2b98c4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLNNUHyl6QhV39asYI8K37doDj5DHtJtY8icRKiaBibtGrDFV1P4v12IgmA%2F640%3Fwx_fmt%3Dpng"/><br/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5638888888888889" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=c54bc4d8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLTbSkQG8OhH0Xicd9kq50GdWiaibAibfORwgkyc8JBDxd3DmhRWXvHpoenQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5722222222222222" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=29fb3121&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLGUiamtW4heaQMtjgfkjcADFhH77xdicKwPezo5O14CdpqB0NibWJbfZ0Q%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5361111111111111" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=29e68bfa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fL8ic09Dl2eB6fKvcic4UMK6jqsGfVkEasjrcNjoT1W53FXQUCFlEJgI0A%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.537962962962963" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=14e598f5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fL91jFGKLOJIKhKicDdvTbqgDiczL50SpD3miaOuibKaGC10YLtRILyMibBGA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5388888888888889" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=e38d39ba&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLJL54TtOT7ibGaN51LoAxd6AV1EicoNiaNgxMFIJAAYUdYwCUF9cu0PaAw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5388888888888889" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=a48086f5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLx3q1icCjNvqNqf1AZ7oibCw6wDNNcLao1jAVia0VAc2nKia8IY0WRnYtPQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5370370370370371" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=e2f93e9b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLNK05lic9vAfDGRBHXDIF5bSmAqPJhELOnLicXMl0VO5RFiauUjKD8wGoQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5277777777777778" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=10ea5f43&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLEtJx4QuPLCDlhGf4FKica4icjBAlaSJK7V2rPUMs28YXURtjZI7snZ4A%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5296296296296297" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=19cf3e33&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLfdpvz6umVtGd4kYNSwxhrTBQRNMGiaicicHyLc2MkIsg82zKaPW0z0KxQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5370370370370371" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=fb57d744&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLDaoWg5vueLeoM31P5K4AklxsckdMBsGzK5ZqibFJgSUvyfJn6YXxWrw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.537962962962963" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=0a7b9d0a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLXibxYbtqjH3avnsOAheCw5Dd4KM8nxSyGcPhyjOKZc1ZEYpXJ3jx58g%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5694444444444444" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=63815015&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fL1ibmCrPKrGES3AU9dEmQHd8OPzOok2rz8jKicHSQ2niaqKG3BI7VOpAaA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5666666666666667" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=45768bf7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLslicMxmelbicyXUHVOeFhXjB6CA15DDHBpcbHSGkHpekQ5Rlxg5T0e4Q%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5638888888888889" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=3937c2b6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLUED6ExQzsntozUANybAM32CUXyEeGpWAzTwiaVn45uxmQJ0hl6aFVnw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5685185185185185" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=05cb9ce2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLPUZrBViaXCvLkPzOSFPSlSWbdHULicauhvWNOiaJqO6U5cutqoUWibBCPA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5694444444444444" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=90098200&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLZx7Gb3mNfHicbuvzedkF6a15E3T8qmwbqMqInnCpVSsFqicQqv3qwlKQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.575" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=faaf8f76&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fL8O2s0R65sQkr3r2s9iahux6IUpQo85Ow1icpoiaxzz1bwnFPhdlHe0k8w%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5703703703703704" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=76c9e618&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLtYQ5MNUjhgGjTRPNkHtm3UPtiaFLjaIUpzRcEJL8ibObUdUE8rYwvVqw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5675925925925925" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=2b9f6974&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLMK3n0iaASf9yTohcnAFkdhQib7N2g5Xo23eQ1jpCHTq5Znx7SdBMfuQw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5685185185185185" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f88ef81a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLMPgEIb1XzZZzQGHeluicUyAmiadibUQTx5icqZTbib7gTXiaLcbbNthiauic6A%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.562962962962963" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=7aa96ef6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLSeR8fibLLKic6PPKOdLEnp1lcWhw6HfwewxEZkicy9qDgiaf6paMlJs4nA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.562962962962963" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=916353f0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fL8jFrbdE2RFm2fTmdicKZV8CMYqK0qLeZicFDTpHI8OwP4wlQ60HtZicJw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5703703703703704" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=399736aa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLjnHw46YsMJsHGay6V346WBFibsicZictRqN0b5MVn2icRHvbicdYcYyic2Mw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5527777777777778" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=3e00e2d9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fL5FlHfqbjew2ENgJcQpDmYHB4w0Gia4tA0OpiceiaVHUiba3DumCstjGepw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5509259259259259" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=e30fa518&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLIoOLpa5ibEia4QBEZOsHgkZRBs8x4KU4j4fJXMAmBJSz2LKJyWFD65lQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5601851851851852" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=8a8c5daa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLmI2IvRM8cZSra1kHJIiaHicszjfSsInJwPoep0a6zDZXd85HqcbXYkDA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5601851851851852" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=b0d802a1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLv6bx7vM2L0mk2NkiabOynehJJicOljwtwvzPGnSeFfjMic6p8NK4zqGbg%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5648148148148148" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=7eb380fb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPibL6ibyVaAl6q3RpJ3wS0fLhJOcOMuAbvN54eKI4b4E9cKMIWcVPKUgkfibYZmqHkicIAZEWcJia6ApA%2F640%3Fwx_fmt%3Dpng"/></p><p>🔥🔥🔥国内技术领先的开源RASP社区：<span style="color: rgb(0, 82, 255);"><strong><a href="https://www.jrasp.com" target="_blank">https://www.jrasp.com</a></strong></span></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="2247484614">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=2cddc142&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzg5MjQ1OTkwMg%3D%3D%26mid%3D2247484614%26idx%3D1%26sn%3D8fdb169f569ebd4acbf39fbd56f8a05b%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 28 Sep 2023 12:24:00 +0800</pubDate>
    </item>
    <item>
      <title>RASP漏洞防御之 shiro 反序列化</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484544&amp;idx=1&amp;sn=69bc11516e13d7b0f020588ad06a8a7c</link>
      <description>“ RASP漏洞防御之 shiro 反序列化” ApacheShiro框架提供了记住我的功能（Remembe</description>
      <content:encoded><![CDATA[<p>
<span>Hsin Tsao</span> <span>2023-06-30 23:17</span> <span style="display: inline-block;">上海</span>
</p>

<p>“ RASP漏洞防御之 shiro 反序列化” ApacheShiro框架提供了记住我的功能（Remembe</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=6ecb7a61&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYMaibMjSZSIcyjdDwAnPFjqiblL3AialHSIUrtJgWIb1vWNAiaE4ZALmvViad3aQkicW1z4icetCxdyXSKWw%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><strong style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;color: rgb(136, 136, 136);font-size: 20px;box-sizing: border-box !important;word-wrap: break-word !important;">“</span></strong><span style="max-width: 100%;color: rgb(136, 136, 136);box-sizing: border-box !important;word-wrap: break-word !important;"> RASP漏洞防御之 shiro 反序列化<strong style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;font-size: 20px;box-sizing: border-box !important;word-wrap: break-word !important;">”</span></strong></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"> ApacheShiro框架提供了记住我的功能（RememberMe），用户登陆成功后会生成经过加密并编码的cookie，在服务端接收cookie值后，Base64解码–&gt;AES解密–&gt;反序列化。攻击者只要找到AES加密的密钥，就可以构造一个恶意对象，对其进行序列化–&gt;AES加密–&gt;Base64编码，然后将其作为cookie的rememberMe字段发送，Shiro将rememberMe进行解密并且反序列化，最终造成反序列化漏洞。</p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">    在反序列化时,不会对其进行过滤,所以如果传入恶意代码将会造成安全问题在 1.2.4 版本前,是默认ASE秘钥,Key: <strong><span style="color: rgb(255, 0, 0);">kPH+bIxk5D2deZiIxcaaaA==</span></strong>,可以直接反序列化执行恶意代码，而在1.2.4之后,ASE秘钥就不为默认了,需要获取到Key才可以进行渗透。<br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="margin-bottom: 0px;"><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;color: rgb(26, 173, 25);font-size: 24px;word-wrap: break-word !important;">01</span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;letter-spacing: 0px;color: rgb(26, 173, 25);font-size: 20px;word-wrap: break-word !important;">—</span></p><p style="max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;margin-bottom: 0px;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;margin-bottom: 0px;"><span style="max-width: 100%;font-size: 20px;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;">模块编写</span></span></p><p style="margin-bottom: 0px;"><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">了解下攻击原理之后，很容易针对性的构建防御模块，借助 jrasp基础设施，很容易堵住漏洞。</p><ul style="list-style-type: square;" class="list-paddingleft-1"><li><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">hook类以及密钥设置<br/></p></li></ul><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="typescript"><code><span class="code-snippet_outer"><span class="code-snippet__keyword">private</span> Set&lt;<span class="code-snippet__built_in">String</span>&gt; shiroBlackKeySet = <span class="code-snippet__keyword">new</span> HashSet&lt;<span class="code-snippet__built_in">String</span>&gt;(Arrays.asList(</span></code><code><span class="code-snippet_outer">       <span class="code-snippet__comment">// 在 1.2.4 版本前,是默认ASE秘钥,Key: kPH+bIxk5D2deZiIxcaaaA== 可以直接反序列化执行恶意代码</span></span></code><code><span class="code-snippet_outer">       <span class="code-snippet__string">&#34;kPH+bIxk5D2deZiIxcaaaA==&#34;</span></span></code><code><span class="code-snippet_outer">));</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__meta">@Override</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">public</span> <span class="code-snippet__built_in">void</span> loadCompleted() {</span></code><code><span class="code-snippet_outer">      <span class="code-snippet__keyword">new</span> EventWatchBuilder(moduleEventWatcher)</span></code><code><span class="code-snippet_outer">            .onClass(<span class="code-snippet__keyword">new</span> ClassMatcher(<span class="code-snippet__string">&#34;org/apache/shiro/mgt/AbstractRememberMeManager&#34;</span>)</span></code><code><span class="code-snippet_outer">                      .onMethod(<span class="code-snippet__string">&#34;getDecryptionCipherKey()[B&#34;</span>, <span class="code-snippet__keyword">new</span> GetDecryptionCipherKeyListener()))</span></code><code><span class="code-snippet_outer">            .build();</span></code><code><span class="code-snippet_outer">}</span></code></pre><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">检测方法：<br/></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer"><span class="code-snippet__keyword">public</span> <span class="code-snippet__class"><span class="code-snippet__keyword">class</span> <span class="code-snippet__title">GetDecryptionCipherKeyListener</span> <span class="code-snippet__keyword">extends</span> <span class="code-snippet__title">AdviceListener</span> </span>{                                                                                                    </span></code><code><span class="code-snippet_outer">    <span class="code-snippet__meta">@Override</span>                                                                                                                                                           </span></code><code><span class="code-snippet_outer">    <span class="code-snippet__function"><span class="code-snippet__keyword">protected</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">afterReturning</span><span class="code-snippet__params">(Advice advice)</span> <span class="code-snippet__keyword">throws</span> Throwable </span>{                                                                                                     </span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">if</span> (disable) {                                                                                                                                                  </span></code><code><span class="code-snippet_outer">            <span class="code-snippet__keyword">return</span>;                                                                                                                                                     </span></code><code><span class="code-snippet_outer">        }                                                                                                                                                               </span></code><code><span class="code-snippet_outer">        String key = Base64.encode((<span class="code-snippet__keyword">byte</span>[]) advice.getReturnObj());                                                                                                     </span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">for</span> (String item : shiroBlackKeySet) {                                                                                                                       </span></code><code><span class="code-snippet_outer">            <span class="code-snippet__keyword">if</span> (StringUtils.isNotBlank(item) &amp;&amp; item.equals(key)) {                                                                                               </span></code><code><span class="code-snippet_outer">                <span class="code-snippet__keyword">boolean</span> enableBlock = shiroRememberMeAction == <span class="code-snippet__number">1</span>;                                                                                                       </span></code><code><span class="code-snippet_outer">                AttackInfo attackInfo = <span class="code-snippet__keyword">new</span> AttackInfo(                                                                                                                 </span></code><code><span class="code-snippet_outer">                        context.get(), metaInfo, key, enableBlock,                                                                                                      </span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__string">&#34;Shiro default passwd&#34;</span>, SHIRO_REMEMBER_ME,                                                                                                      </span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__string">&#34;detect shiro default cipher key: &#34;</span> + key,                                                                                                      </span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__number">100</span>);                                                                                                                                           </span></code><code><span class="code-snippet_outer">                log.attack(attackInfo);                                                                                                                                 </span></code><code><span class="code-snippet_outer">                <span class="code-snippet__keyword">if</span> (enableBlock) {                                                                                                                                      </span></code><code><span class="code-snippet_outer">                    ProcessController.throwsImmediatelyAndSendResponse(attackInfo, raspConfig, <span class="code-snippet__keyword">new</span> RuntimeException(<span class="code-snippet__string">&#34;detect shiro default cipher key block by JRASP.&#34;</span>));</span></code><code><span class="code-snippet_outer">                }                                                                                                                                                       </span></code><code><span class="code-snippet_outer">                <span class="code-snippet__keyword">return</span>;                                                                                                                                                 </span></code><code><span class="code-snippet_outer">            }                                                                                                                                                           </span></code><code><span class="code-snippet_outer">        }                                                                                                                                                               </span></code><code><span class="code-snippet_outer">    }                                                                                                                                                                   </span></code><code><span class="code-snippet_outer">}</span></code></pre><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"><br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;">代码详见：https://github.com/jvm-rasp/jrasp-agent.git<br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;">说明：代码由 </span><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(0, 209, 0);">@是小易呀</span><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;">、</span><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(0, 209, 0);">@hycsxs</span><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"> 提供<br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;color: rgb(26, 173, 25);font-size: 24px;word-wrap: break-word !important;">02</span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;letter-spacing: 0px;color: rgb(26, 173, 25);font-size: 20px;word-wrap: break-word !important;">—</span><br style="max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;font-size: 20px;box-sizing: border-box !important;word-wrap: break-word !important;">实战<br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.8222222222222222" data-s="300,640" style="" data-type="png" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=9ee02b67&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMaibMjSZSIcyjdDwAnPFjqibtLNYTfsTWkASaXeS7vSvo4ZjaKluEc1dZ0ibGaP6XZvp33zDuLztGlw%2F640%3Fwx_fmt%3Dpng"/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p><p style="max-width: 100%;min-height: 1em;box-sizing: border-box !important;word-wrap: break-word !important;">攻击日志：</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="json"><code><span class="code-snippet_outer"><span class="code-snippet__number">2023</span><span class="code-snippet__number">-06</span><span class="code-snippet__number">-30</span> <span class="code-snippet__number">23</span>:<span class="code-snippet__number">03</span>:<span class="code-snippet__number">16.597</span> WARNING MacBook-Pro.local [http-nio<span class="code-snippet__number">-8080</span>-exec<span class="code-snippet__number">-1</span>] [attack.attack] </span></code><code><span class="code-snippet_outer">{</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;context&#34;</span>:{</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;method&#34;</span>:<span class="code-snippet__string">&#34;GET&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;protocol&#34;</span>:<span class="code-snippet__string">&#34;HTTP/1.1&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;localAddr&#34;</span>:<span class="code-snippet__string">&#34;127.0.0.1&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;remoteHost&#34;</span>:<span class="code-snippet__string">&#34;127.0.0.1&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;requestURL&#34;</span>:<span class="code-snippet__string">&#34;http://localhost:8080/login&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;requestURI&#34;</span>:<span class="code-snippet__string">&#34;/login&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;contentType&#34;</span>:<span class="code-snippet__string">&#34;null&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;contentLength&#34;</span>:<span class="code-snippet__number">-1</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;characterEncoding&#34;</span>:<span class="code-snippet__string">&#34;null&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;parameters&#34;</span>:<span class="code-snippet__string">&#34;&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;header&#34;</span>:<span class="code-snippet__string">&#34;c:cHdk\naccept-language:zh-CN,zh;q=0.9\ncookie:rememberMe=iIJnNjiUTIHEC7iiowOrSJg2KNEvxWSzFAhkyB57S4SdR1ovC7rQ2Q69yBzQG1YSR4b0Oct5F7kwgXoC5eoXjDlPf45F77RQpt2RxO3xO5F+t0hpRP+tW2O/vPxeM7KFMlCVenJs4/XuNvuVDiNa17o0/DfDNRm5+hArH30fm3JOptnubtBOXTC0btpYfqanrpt2eBH3Zl4JJXd+L1hba/f3djqjG+Q7jOPg4UIfnPeGdxvr1xP2b44KsWKXVcbN/YopzvAAczoIAy0VydQBmlVDRyY5NVPQocLjdiTG4dVwqgXS+qJDFasnzbSvPQejVfjrEhCE2o6zKCW2fl3uT93fMj5kZVzxTo8t2xPh6ASPa/I9O4AF/Db2xeWIGxNcyMsdmxjDTntc5NYLEuwtMA+TKw8km6OKGgjcMLR1NGxdRlMfcy5n4poJxpOeex7QSsp6QB80Ex0KTmYN1jlhxXCOdqEwmA7keTwhypoyH+eVxg5wBNCBew71akE+M8AsezyOdTyvG1H5u9uoWLIHJ23pFcHMxysVG4EXVGrDKx35GwAQNmONggQ7Fn3pILTdJHOpKYH72tV4wCQ8ajjK4f1IOSZFQQp0BL9S6N1Yatp2zEs0C3Y/pbcvzNijxy/dK0JEKQU9PhYKPRi3yQM/Skuv9Ff3bx9YVDw3YAXz027fTZZWKrbDlzNW2m7wdsE89USThz7a7jaKP/NSR7/FpVcElS5xzsvQRFW3L4X3T6b9i5CXMWSVF6VetBSxyjI60C9DNUTHt/sG+aDIAsP0Q2jUjIi2txW45P1jzQc4zdwF5Xab0hv71FFJphSdTXtDu2DVIpQyeo2twR1rvwt/OyiSoBfBmHfwLziOEZmqBMY5Hpq9I+pjhqcip5B2KyYdBRuQtBXjA57XZPz/ypdheQgmQ220bByvkc14Nf6xTboWOu2zCYtTuumCmFyLr0prq1+/vHddbyV7VEeOYNnx9gsaK2Zx4caec9WO5QKsCaKkwlhCRZ8CSqRSXp0dq6sAEgSKj2XJPxWY8+Bk0Hv8hm/kurCFlOU8TB3FwW0/tz7NO0fMOefGxsXb8tP9tSqzAknQGQ4khcorWM6wxjMBg3u4p/vcKQ2luvooOvb8vHLhj9P2w8dbkqF/Wk03RSKfCOmBr9O0PWQsHski6OTjNwhfr3Ca89c3a6qSzh0ERuDvvq8sevyzjYwsXFXjOxsLUk6YC/UPMKA6CQ96oSMYUA3wowOk1FEsPSurZk9ff2p7sW+MrCMzMpq4vW+jx2ilmlJwVbk0JpQPskJmWeLYRX8MsNVsLbMKtp1WNQpXFCouUiAW7WBzRFXn+h+YrdhSjjXFBVk54+o0WSE6066fUKnlmSD3d5A6qdaXbT5mByYcYUBl9sTGDiZa1b5nbCTjLAK93ZqpyNjBQ+lmnsmvMvpJAhbXQ9CbaxAtYoHJX0qjjrkxsWVb3rIx4lnR4EaELfBh7boAHfxmb8p8SZSh08Aap4ztkVp3pADLiK353zlVmI90MRl6ovOVUGbdrvsIf59igCCP6b6Ub57Wjkj9gSzNXgPaNEzpmcXxY7kju7Tbaq6ZnaylpJnsutmj6dGIv+bEaEOzHHrBgmG5lHbIPxVltx1DONpbjkKwIF1IAxYE/S5UkMZkqjorKCIhKWg5VMFest5scZ20x9kMrMBFKBBPmo0RYdctelxp+YaT4TKscgnNDjWb/ZhOoIdDQ0pqwnFbydox4QMThX/gEYuzmt3ZLKuV2QvcTI1Hosjd/QqTsSOJpBCNQ+/UaHSxH8lsuEnYz7GH3O3Dww2g8T6pOOON6EWUBv8T3DCaivxF0us1h4A1xuIMUHwPwfmUgkgl1uLL6uqGgOchrj1YoPHq8ePFCjEeCWfCpqKU6rJZkj9eiBEUiQxoWLg2NXexxcnhYMwxnf+FlHbDCtzqL+bTOjvBWZV/oeJoq7/ITnJD2pdkRmXxcgagFJKUesKRu32kFh6wDXnBPLdx2uaaBU+iv1RLodeKzEfBp5spIpfFDFHdOgY++98OxEUUGAopPdmthpOwniIv94w1rzbcUWe91RCC0a/CSCs9KgkAKGI/IG7nNLdSao8ZmNkxBJYguoPNQZqdRYXnIIChgp2guSoxsD34orFgoXCIK1NQpJPhmxXefyTFc6GWhWbJ6mrmL41SDEE0VZCVfFUC1dAtO5yvZH/B4eooLTxCj59J31CzroHNn8plem/9Rq4Uva4pqk8wvL7yH0u6vVJJrhO90ehas2LlJXo/pZa5og5GETy2Co1dW3whpOCJQKuEyWBm7rDAH19cQD+tgI6apYEdFwdCY/mliwuzS+eOXiGH7yNsfnEPiPMVEyq4HGwEtM1tnuSbMcxcRdX8L6x+OyFGr0TPVSolWkz9+ObgTaEFmGJJUs76DIsPkSF8ps+6fsa5OGJY+d9vzEQ0sW9Jw+oCUIpcrcfZU3fh2ipbTo17ipRUMuPipwlWEmEAzErg1iyhrHFvuP7CMrIcqAzIJdbHnzdAWAKg+lnOe4BlBe0O4Y7IsmAmFevNjgYGf9/goWNtLmuOnioRvMUH57mYHOw/22lFgpj/Bn/2DhVMAUFUer57puuMnYTwcnrs7UAa7XW9oXbBystxMoHsc/b5iXUszhidhXs1zO5WOj53EcgUtyVpdin660peAkgIwA9LHvqSQX4cesqSciyN+MZS3NCbzLfusRZRNfJy0u9f0EA8e9BWt8s1l1SDtuX3X492sdfC+2yL+70tFW7r1mWe0w/F6fttEyhDIH3EemIQiS2drL2lbYXETVzd/0rqkJqNYRn/frw0BzqT8kUDJeBeV6tLvVILaE1yq+MY65RRvhggGm3v/CoGAQBM2ffgSCV3uvG74vy7lasloE9VmLdMaEfLemS9RtCamw0PxHwrfHfGXoZ0qGABNrmOuAr2Ulxoez5nr8mpbqOUs38hze2eBoLYd/3JGytHdgI1m6sq3HSsr/a28rVs3xIHjb1kWy/cdQItljfS7l+qeHUFH7DbDJ9arliziCPQ5adGLsGUc2JMKwb3QdmMPrLhtITWPHxaz2AsBk+n7yb4twUGsbK7cgfvLuK91Ysqow/sbsUrJqTRwyky2crtMW0hu5wQ+N2QsaPLiV+P72sgWiUPOoJG09zw5/D9ZTZtA2O7UXuKdrfnXeq8TzLwdY5hvP1RKEWMzoT1GztzDYsDLKDXaKnRhxPwwc433kDuibbWPxgNsmZPjNE5o35ELm7VShc6SdCNJ6B8HceEvyYinrmQKYKVpIvDjDw6IiKSdmw/FhetRERUi4kBTwjeGstd4Yhkyv1mGwl3LxBv/OT6FSfM0WUyzq43NGnlqkzuq7u6znpfz6+F6mq7zq/PqzUhw0OLYRSzMxUsqbaCSMMZ0J7A9eFNC3FKkWGRaDZv7H+EuXZeG4EzcHjUX64rM1/bKnjSLd4SadFOdglCHjZBnfZcXTuXRuAUGfkQRz2YroTL7b9KQG0ABaMOy0+4ex3fpGN+P2j3jNh9iCOW1GTY6CSt9aRX6Yx8ppXcDMFhxhNhGsqoCf9X1dM8aMn9wO4Lt21EDEJ7jCM5nPfdA5B5uvuRYK/3r1/ibPyM7XN2DUYbo86mJdMAzGY0G7O32tUb+jsGzT/DCBZYw93y5s2gwIOhhC2OmOpt+Kxu8r4vKWBBdq5t1UZtX9beC5VEpiGV3wdHLwHTqzYA1enRmsaFoWlGicJQd+Uxb0JMX6Oe0QDs2aJAYz+t6VmQJVv34bURhf9ZNj/aMhclhRn1Z8qP5cIiipzzIpuVDa2yoBA+EW+Kifi1OBBUxv2U//HA+vZ0hBfvSvMr0lVmB4/rTVxUajTtm8ilGC0MUL3FJOf7SMWZwNMRWOukjOw8aLn3QMO6UmfciRomrcAHEy5ebdQvzI+7WuzH9wX8LuzQd4vtvWqD1jC1WmZQdPPGMzem3Z0O7NDk3kFS+VzNYJ6agnn+wBYpEDQ8/G4PrdhYxfuoM66+d+WKfPqgPjC0/DjJbg98ZwpfnWFvgxRvunEKcBs7ooytIsZLidmOTC4uf4M8XnpjhvJSqHdqRh1154rRXAsimLi7VAVdchIPaTbNwtS4HEuG5KKV45eidv+BBf/NOzjK7EhH4HqqjKem3EThDpH5D+lSYoKNlb/Cybc15Q0xkkPrTM72oAWXx/LJhlv7qQeYfIxLErBNZ2vytDLYW6noZCCYWYFZBXO8Itzs23rn0tfM8E+APq027frJxD3rURA6sZojGm7TjUsizkONEw3LjPc4B3kmIIQatw38092ZLHNQePk0FH6SDNVEnoRINW1ZOqV+mWr6wrJLqVDpzbS/fjXFJCj2tW8vExkFqq7sQ23VFpJtm+w7E9DY51xYrKWyW3KyW9znoHzNdP4cwtBpU7Gb6fOYnjGSxoHrQFQRrSZf5Elj32t1zdHrcc0+1Pw3W0e2bX5dB4CD8d80sXI2KgJd6kyWYht5mhKKmO3vi+1R0EQJs3A+XHYQTnKpn7f001t3V5qfe7sHl32IhUqT7IMgOQ5o6DZ4uimg4aKlhAsZCTJy7064TUFHIdZ00+SunAx3SktscbnSZQZ/BkaB631AKO2Ezqm/RBso/bPFowc2mIRxkRILpwE/R3g1gvpfBvUY1OlW0A4nzB/CGoZrpIAjnbTdQT0GGHbizW7oIBUBfM4xgr3e1poqn7/FK/sZ09isGfFbLtoPKDMDMe20Ogjr7p68dqeuYW1ghrk/ddu09LlvIWjRWRV2uou/PmSi0jzCFWbs0ApHSQm+cbPu79Xehx+qM+yk1tn9OUzJ9QLTaFD8k8dk9Eg9NEVwqGa+2Rjt5tvIZpbFhO4LtA1k7SaRqEKQKlNoN9BJyRIVR3+p6mMvts05M/8zU2z5lYL+H8rRtH0ER2qnNQZtSVkaDTw8vKDNMtG7Atk6ElhmKVwCk1GK7XpKIzYS2BGQPecafZD5LWy8E8wMsWNnSTUu+rJ8zbRQxncU+96O1hHHXyRVQYePF93V4wG4ytMHsMEaD543EoL31yVj3XC13TDAe7kbwcHhNWyjZNR4ucl+x8h2Vu9soCdLsBFoyCQAg/WDY1GuyWWBbkgKmqnuT88IS1Q0/NLshGF0Jg5jW2/k7pD7Vj2i7/cwLfGF7LSnZVZa9Aq68OS253jtwDCl5Fd99M0nJ8b0Yv8VSsLTBWnZHOpgrEa3/XO4aTc9izB1iexrkKP9lPKkxPDe2uWRLcjMRoVWJVpDimE1j4aG9kz8j4TnEZ075Zpyx51/oMjKNSm6KsVOScDGxJjCujBn80gBhiVP8hiLQzubQxsgj3aktbeeReamw7TTGr+AjaEj9ezc36B7AHoWzs+HGSouRPmLAS0ngJ19L5/XJyJQYA6ZrHSJjFoKqO+AHiPQLJ4Gd3VGeSAx7NF2dV3mRsdLjYmsX4MFrt8+kxhX8CnibrFPTbGinfjI/Y89L1Av0B4lKz+DcpuEfM9cvnsW7JYurUD/e4tZbnmuS3hRFvRteiGPuyclqtI1vGc2f22PpptgPiiMrM+ZxgLiCV8NrH5tSFlx0k+T9jjBqo/iMgqugSt4GsBb84zQ5Tk5ahkl1qF5Dbgobu3yt3uPLcgMdSqqpWeARK8zSuBjL0ZrdbdzZuVO1sYIHkEJepvMoL+3ReFs0HBgKLNAqgLsBhSlRX4py6/sVzXOZu6Mn0EmG1YxaDuKUJ8LPaCKnYTP/QV6PZQnz9xCz6hgmKfcFa2sEIrk2N2Trv4C6LhJbzGJ7780KdXHtpS3kyf4qI32TgkXncUroHb8IPzPii1d+hqar1jEYurKxW2pzoe8uSV3fzUli8dVnm6K3Z+DJI7tjLWcDv7aVrMurE+CXZMQiKfzAl/tRbo2/SF3U/tkxC3RUj34ijrW6chYjRHh7uZMKJ1YHFFP7IVIMsVsCguWtBBvd+JA+xGori6y5fNPxtGZLYdQ6RafoPuWxJUhq5tkLpTg3dU8piMW4lqOcxd5wLZAW4lbypfS9bzg+6TbfZHT00Zfwxujtg94uNgRknj14sAnfSIPUdz3QsSeYgbSgH4EqKklDVgQ3y0lUVhCk3afH35b8ygk+xALyDLDclgJt/MABQ8GQ8PwVQelYKRwvhhG+Pm6eC9VgOQPMl+GmZJ0KWmAByvu7QO7eAWr5PjQ3WeO4mb9JQ8uMzp4+m2Hu9GFFIM97B0lY+KrbG3FN9T0dnM1XkSor1Jd8hcut3gudStRSzJJWruf1MjXURd7BJpb73iJN8dzCoXaohSLUBOAvwCvbA9obFcwiZF+0RilovwXrU0RC4XxO1ecWchZtFG9+TAMMDjXnrAG+eeD+D5XpvuJpUm9Ot0/OlGe5sc/jfcwL5+SppGh7Tw3ieRBxARVkfaiL8fA5IFTd5sVMBImhw3IJMawxw5SwbsBHmwipGfMF5w4N13YO2ITyiKg0Vwvkal+2yE2I0Ri1veJv3RoFWcEw8nN+8rH/Cm7CgmqMyqa+CZ/Ke1GRJIdxOzv9ZpNhL+HzkEZROxyQx3e12zI9CxqHUTUFTLhxv7ANJiQm2ooFuNedSckykPQIlXB6dZa3hs9AF1sPMCYyRkbaVqc6NEt90DGX2o6WnWAQhgmUl+rc3qVTcg2dy9D9Po4JMn+B+PXXjRPIfir5GaxCsNAuQqZ7SEqHyED11B/5qCaQcqH/g==\nhost:localhost:8080\nconnection:close\naccept-encoding:gzip, deflate\nuser-agent:Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)\naccept: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&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;queryString&#34;</span>:<span class="code-snippet__string">&#34;&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;marks&#34;</span>:<span class="code-snippet__string">&#34;&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__attr">&#34;body&#34;</span>:<span class="code-snippet__string">&#34;&#34;</span></span></code><code><span class="code-snippet_outer">    },</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;appName&#34;</span>:<span class="code-snippet__string">&#34;null&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;metaInfo&#34;</span>:<span class="code-snippet__string">&#34;shiro-hook-1.1.2-2023-06-30T15:00:36Z&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;stackTrace&#34;</span>:<span class="code-snippet__string">&#34;org.apache.shiro.mgt.AbstractRememberMeManager.getDecryptionCipherKey(AbstractRememberMeManager.java:202),org.apache.shiro.mgt.AbstractRememberMeManager.decrypt(AbstractRememberMeManager.java:489),org.apache.shiro.mgt.AbstractRememberMeManager.convertBytesToPrincipals(AbstractRememberMeManager.java:429),org.apache.shiro.mgt.AbstractRememberMeManager.getRememberedPrincipals(AbstractRememberMeManager.java:396),org.apache.shiro.mgt.DefaultSecurityManager.getRememberedIdentity(DefaultSecurityManager.java:604),org.apache.shiro.mgt.DefaultSecurityManager.resolvePrincipals(DefaultSecurityManager.java:492),org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:342),org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846),org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:148),org.apache.shiro.web.servlet.AbstractShiroFilter.createSubject(AbstractShiroFilter.java:292),org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:359),org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166),org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100),org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166),org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93),org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166),org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201),org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166),org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202),org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96),org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526),org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139),org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92),org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74),org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343),org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367),org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65),org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860),org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591),org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49),java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149),java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624),org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61),java.lang.Thread.run(Thread.java:748)&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;payload&#34;</span>:<span class="code-snippet__string">&#34;kPH+bIxk5D2deZiIxcaaaA==&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;isBlocked&#34;</span>:<span class="code-snippet__literal">false</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;attackType&#34;</span>:<span class="code-snippet__string">&#34;Shiro default passwd&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;algorithm&#34;</span>:<span class="code-snippet__string">&#34;shiro-remember-me&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;extend&#34;</span>:<span class="code-snippet__string">&#34;detect shiro default cipher key: kPH+bIxk5D2deZiIxcaaaA==&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;attackTime&#34;</span>:<span class="code-snippet__number">1688137396594</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__attr">&#34;level&#34;</span>:<span class="code-snippet__number">100</span></span></code><code><span class="code-snippet_outer">}</span></code></pre><p><span style="display: none;line-height: 0px;">‍</span></p><p style="margin-bottom: 0px;"> 如果不阻断，还会有rce日志</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="bash"><code><span class="code-snippet_outer">2023-06-30 23:03:26.352 WARNING MacBook-Pro.local [http-nio-8080-exec-1] [attack.attack]</span></code><code><span class="code-snippet_outer">{</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;context&#34;</span>:{</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;method&#34;</span>:<span class="code-snippet__string">&#34;GET&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;protocol&#34;</span>:<span class="code-snippet__string">&#34;HTTP/1.1&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;localAddr&#34;</span>:<span class="code-snippet__string">&#34;127.0.0.1&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;remoteHost&#34;</span>:<span class="code-snippet__string">&#34;127.0.0.1&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;requestURL&#34;</span>:<span class="code-snippet__string">&#34;http://localhost:8080/login&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;requestURI&#34;</span>:<span class="code-snippet__string">&#34;/login&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;contentType&#34;</span>:<span class="code-snippet__string">&#34;null&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;contentLength&#34;</span>:-1,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;characterEncoding&#34;</span>:<span class="code-snippet__string">&#34;null&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;parameters&#34;</span>:<span class="code-snippet__string">&#34;&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;header&#34;</span>:<span class="code-snippet__string">&#34;c:cHdk\naccept-language:zh-CN,zh;q=0.9\ncookie:rememberMe=iIJnNjiUTIHEC7iiowOrSJg2KNEvxWSzFAhkyB57S4SdR1ovC7rQ2Q69yBzQG1YSR4b0Oct5F7kwgXoC5eoXjDlPf45F77RQpt2RxO3xO5F+t0hpRP+tW2O/vPxeM7KFMlCVenJs4/XuNvuVDiNa17o0/DfDNRm5+hArH30fm3JOptnubtBOXTC0btpYfqanrpt2eBH3Zl4JJXd+L1hba/f3djqjG+Q7jOPg4UIfnPeGdxvr1xP2b44KsWKXVcbN/YopzvAAczoIAy0VydQBmlVDRyY5NVPQocLjdiTG4dVwqgXS+qJDFasnzbSvPQejVfjrEhCE2o6zKCW2fl3uT93fMj5kZVzxTo8t2xPh6ASPa/I9O4AF/Db2xeWIGxNcyMsdmxjDTntc5NYLEuwtMA+TKw8km6OKGgjcMLR1NGxdRlMfcy5n4poJxpOeex7QSsp6QB80Ex0KTmYN1jlhxXCOdqEwmA7keTwhypoyH+eVxg5wBNCBew71akE+M8AsezyOdTyvG1H5u9uoWLIHJ23pFcHMxysVG4EXVGrDKx35GwAQNmONggQ7Fn3pILTdJHOpKYH72tV4wCQ8ajjK4f1IOSZFQQp0BL9S6N1Yatp2zEs0C3Y/pbcvzNijxy/dK0JEKQU9PhYKPRi3yQM/Skuv9Ff3bx9YVDw3YAXz027fTZZWKrbDlzNW2m7wdsE89USThz7a7jaKP/NSR7/FpVcElS5xzsvQRFW3L4X3T6b9i5CXMWSVF6VetBSxyjI60C9DNUTHt/sG+aDIAsP0Q2jUjIi2txW45P1jzQc4zdwF5Xab0hv71FFJphSdTXtDu2DVIpQyeo2twR1rvwt/OyiSoBfBmHfwLziOEZmqBMY5Hpq9I+pjhqcip5B2KyYdBRuQtBXjA57XZPz/ypdheQgmQ220bByvkc14Nf6xTboWOu2zCYtTuumCmFyLr0prq1+/vHddbyV7VEeOYNnx9gsaK2Zx4caec9WO5QKsCaKkwlhCRZ8CSqRSXp0dq6sAEgSKj2XJPxWY8+Bk0Hv8hm/kurCFlOU8TB3FwW0/tz7NO0fMOefGxsXb8tP9tSqzAknQGQ4khcorWM6wxjMBg3u4p/vcKQ2luvooOvb8vHLhj9P2w8dbkqF/Wk03RSKfCOmBr9O0PWQsHski6OTjNwhfr3Ca89c3a6qSzh0ERuDvvq8sevyzjYwsXFXjOxsLUk6YC/UPMKA6CQ96oSMYUA3wowOk1FEsPSurZk9ff2p7sW+MrCMzMpq4vW+jx2ilmlJwVbk0JpQPskJmWeLYRX8MsNVsLbMKtp1WNQpXFCouUiAW7WBzRFXn+h+YrdhSjjXFBVk54+o0WSE6066fUKnlmSD3d5A6qdaXbT5mByYcYUBl9sTGDiZa1b5nbCTjLAK93ZqpyNjBQ+lmnsmvMvpJAhbXQ9CbaxAtYoHJX0qjjrkxsWVb3rIx4lnR4EaELfBh7boAHfxmb8p8SZSh08Aap4ztkVp3pADLiK353zlVmI90MRl6ovOVUGbdrvsIf59igCCP6b6Ub57Wjkj9gSzNXgPaNEzpmcXxY7kju7Tbaq6ZnaylpJnsutmj6dGIv+bEaEOzHHrBgmG5lHbIPxVltx1DONpbjkKwIF1IAxYE/S5UkMZkqjorKCIhKWg5VMFest5scZ20x9kMrMBFKBBPmo0RYdctelxp+YaT4TKscgnNDjWb/ZhOoIdDQ0pqwnFbydox4QMThX/gEYuzmt3ZLKuV2QvcTI1Hosjd/QqTsSOJpBCNQ+/UaHSxH8lsuEnYz7GH3O3Dww2g8T6pOOON6EWUBv8T3DCaivxF0us1h4A1xuIMUHwPwfmUgkgl1uLL6uqGgOchrj1YoPHq8ePFCjEeCWfCpqKU6rJZkj9eiBEUiQxoWLg2NXexxcnhYMwxnf+FlHbDCtzqL+bTOjvBWZV/oeJoq7/ITnJD2pdkRmXxcgagFJKUesKRu32kFh6wDXnBPLdx2uaaBU+iv1RLodeKzEfBp5spIpfFDFHdOgY++98OxEUUGAopPdmthpOwniIv94w1rzbcUWe91RCC0a/CSCs9KgkAKGI/IG7nNLdSao8ZmNkxBJYguoPNQZqdRYXnIIChgp2guSoxsD34orFgoXCIK1NQpJPhmxXefyTFc6GWhWbJ6mrmL41SDEE0VZCVfFUC1dAtO5yvZH/B4eooLTxCj59J31CzroHNn8plem/9Rq4Uva4pqk8wvL7yH0u6vVJJrhO90ehas2LlJXo/pZa5og5GETy2Co1dW3whpOCJQKuEyWBm7rDAH19cQD+tgI6apYEdFwdCY/mliwuzS+eOXiGH7yNsfnEPiPMVEyq4HGwEtM1tnuSbMcxcRdX8L6x+OyFGr0TPVSolWkz9+ObgTaEFmGJJUs76DIsPkSF8ps+6fsa5OGJY+d9vzEQ0sW9Jw+oCUIpcrcfZU3fh2ipbTo17ipRUMuPipwlWEmEAzErg1iyhrHFvuP7CMrIcqAzIJdbHnzdAWAKg+lnOe4BlBe0O4Y7IsmAmFevNjgYGf9/goWNtLmuOnioRvMUH57mYHOw/22lFgpj/Bn/2DhVMAUFUer57puuMnYTwcnrs7UAa7XW9oXbBystxMoHsc/b5iXUszhidhXs1zO5WOj53EcgUtyVpdin660peAkgIwA9LHvqSQX4cesqSciyN+MZS3NCbzLfusRZRNfJy0u9f0EA8e9BWt8s1l1SDtuX3X492sdfC+2yL+70tFW7r1mWe0w/F6fttEyhDIH3EemIQiS2drL2lbYXETVzd/0rqkJqNYRn/frw0BzqT8kUDJeBeV6tLvVILaE1yq+MY65RRvhggGm3v/CoGAQBM2ffgSCV3uvG74vy7lasloE9VmLdMaEfLemS9RtCamw0PxHwrfHfGXoZ0qGABNrmOuAr2Ulxoez5nr8mpbqOUs38hze2eBoLYd/3JGytHdgI1m6sq3HSsr/a28rVs3xIHjb1kWy/cdQItljfS7l+qeHUFH7DbDJ9arliziCPQ5adGLsGUc2JMKwb3QdmMPrLhtITWPHxaz2AsBk+n7yb4twUGsbK7cgfvLuK91Ysqow/sbsUrJqTRwyky2crtMW0hu5wQ+N2QsaPLiV+P72sgWiUPOoJG09zw5/D9ZTZtA2O7UXuKdrfnXeq8TzLwdY5hvP1RKEWMzoT1GztzDYsDLKDXaKnRhxPwwc433kDuibbWPxgNsmZPjNE5o35ELm7VShc6SdCNJ6B8HceEvyYinrmQKYKVpIvDjDw6IiKSdmw/FhetRERUi4kBTwjeGstd4Yhkyv1mGwl3LxBv/OT6FSfM0WUyzq43NGnlqkzuq7u6znpfz6+F6mq7zq/PqzUhw0OLYRSzMxUsqbaCSMMZ0J7A9eFNC3FKkWGRaDZv7H+EuXZeG4EzcHjUX64rM1/bKnjSLd4SadFOdglCHjZBnfZcXTuXRuAUGfkQRz2YroTL7b9KQG0ABaMOy0+4ex3fpGN+P2j3jNh9iCOW1GTY6CSt9aRX6Yx8ppXcDMFhxhNhGsqoCf9X1dM8aMn9wO4Lt21EDEJ7jCM5nPfdA5B5uvuRYK/3r1/ibPyM7XN2DUYbo86mJdMAzGY0G7O32tUb+jsGzT/DCBZYw93y5s2gwIOhhC2OmOpt+Kxu8r4vKWBBdq5t1UZtX9beC5VEpiGV3wdHLwHTqzYA1enRmsaFoWlGicJQd+Uxb0JMX6Oe0QDs2aJAYz+t6VmQJVv34bURhf9ZNj/aMhclhRn1Z8qP5cIiipzzIpuVDa2yoBA+EW+Kifi1OBBUxv2U//HA+vZ0hBfvSvMr0lVmB4/rTVxUajTtm8ilGC0MUL3FJOf7SMWZwNMRWOukjOw8aLn3QMO6UmfciRomrcAHEy5ebdQvzI+7WuzH9wX8LuzQd4vtvWqD1jC1WmZQdPPGMzem3Z0O7NDk3kFS+VzNYJ6agnn+wBYpEDQ8/G4PrdhYxfuoM66+d+WKfPqgPjC0/DjJbg98ZwpfnWFvgxRvunEKcBs7ooytIsZLidmOTC4uf4M8XnpjhvJSqHdqRh1154rRXAsimLi7VAVdchIPaTbNwtS4HEuG5KKV45eidv+BBf/NOzjK7EhH4HqqjKem3EThDpH5D+lSYoKNlb/Cybc15Q0xkkPrTM72oAWXx/LJhlv7qQeYfIxLErBNZ2vytDLYW6noZCCYWYFZBXO8Itzs23rn0tfM8E+APq027frJxD3rURA6sZojGm7TjUsizkONEw3LjPc4B3kmIIQatw38092ZLHNQePk0FH6SDNVEnoRINW1ZOqV+mWr6wrJLqVDpzbS/fjXFJCj2tW8vExkFqq7sQ23VFpJtm+w7E9DY51xYrKWyW3KyW9znoHzNdP4cwtBpU7Gb6fOYnjGSxoHrQFQRrSZf5Elj32t1zdHrcc0+1Pw3W0e2bX5dB4CD8d80sXI2KgJd6kyWYht5mhKKmO3vi+1R0EQJs3A+XHYQTnKpn7f001t3V5qfe7sHl32IhUqT7IMgOQ5o6DZ4uimg4aKlhAsZCTJy7064TUFHIdZ00+SunAx3SktscbnSZQZ/BkaB631AKO2Ezqm/RBso/bPFowc2mIRxkRILpwE/R3g1gvpfBvUY1OlW0A4nzB/CGoZrpIAjnbTdQT0GGHbizW7oIBUBfM4xgr3e1poqn7/FK/sZ09isGfFbLtoPKDMDMe20Ogjr7p68dqeuYW1ghrk/ddu09LlvIWjRWRV2uou/PmSi0jzCFWbs0ApHSQm+cbPu79Xehx+qM+yk1tn9OUzJ9QLTaFD8k8dk9Eg9NEVwqGa+2Rjt5tvIZpbFhO4LtA1k7SaRqEKQKlNoN9BJyRIVR3+p6mMvts05M/8zU2z5lYL+H8rRtH0ER2qnNQZtSVkaDTw8vKDNMtG7Atk6ElhmKVwCk1GK7XpKIzYS2BGQPecafZD5LWy8E8wMsWNnSTUu+rJ8zbRQxncU+96O1hHHXyRVQYePF93V4wG4ytMHsMEaD543EoL31yVj3XC13TDAe7kbwcHhNWyjZNR4ucl+x8h2Vu9soCdLsBFoyCQAg/WDY1GuyWWBbkgKmqnuT88IS1Q0/NLshGF0Jg5jW2/k7pD7Vj2i7/cwLfGF7LSnZVZa9Aq68OS253jtwDCl5Fd99M0nJ8b0Yv8VSsLTBWnZHOpgrEa3/XO4aTc9izB1iexrkKP9lPKkxPDe2uWRLcjMRoVWJVpDimE1j4aG9kz8j4TnEZ075Zpyx51/oMjKNSm6KsVOScDGxJjCujBn80gBhiVP8hiLQzubQxsgj3aktbeeReamw7TTGr+AjaEj9ezc36B7AHoWzs+HGSouRPmLAS0ngJ19L5/XJyJQYA6ZrHSJjFoKqO+AHiPQLJ4Gd3VGeSAx7NF2dV3mRsdLjYmsX4MFrt8+kxhX8CnibrFPTbGinfjI/Y89L1Av0B4lKz+DcpuEfM9cvnsW7JYurUD/e4tZbnmuS3hRFvRteiGPuyclqtI1vGc2f22PpptgPiiMrM+ZxgLiCV8NrH5tSFlx0k+T9jjBqo/iMgqugSt4GsBb84zQ5Tk5ahkl1qF5Dbgobu3yt3uPLcgMdSqqpWeARK8zSuBjL0ZrdbdzZuVO1sYIHkEJepvMoL+3ReFs0HBgKLNAqgLsBhSlRX4py6/sVzXOZu6Mn0EmG1YxaDuKUJ8LPaCKnYTP/QV6PZQnz9xCz6hgmKfcFa2sEIrk2N2Trv4C6LhJbzGJ7780KdXHtpS3kyf4qI32TgkXncUroHb8IPzPii1d+hqar1jEYurKxW2pzoe8uSV3fzUli8dVnm6K3Z+DJI7tjLWcDv7aVrMurE+CXZMQiKfzAl/tRbo2/SF3U/tkxC3RUj34ijrW6chYjRHh7uZMKJ1YHFFP7IVIMsVsCguWtBBvd+JA+xGori6y5fNPxtGZLYdQ6RafoPuWxJUhq5tkLpTg3dU8piMW4lqOcxd5wLZAW4lbypfS9bzg+6TbfZHT00Zfwxujtg94uNgRknj14sAnfSIPUdz3QsSeYgbSgH4EqKklDVgQ3y0lUVhCk3afH35b8ygk+xALyDLDclgJt/MABQ8GQ8PwVQelYKRwvhhG+Pm6eC9VgOQPMl+GmZJ0KWmAByvu7QO7eAWr5PjQ3WeO4mb9JQ8uMzp4+m2Hu9GFFIM97B0lY+KrbG3FN9T0dnM1XkSor1Jd8hcut3gudStRSzJJWruf1MjXURd7BJpb73iJN8dzCoXaohSLUBOAvwCvbA9obFcwiZF+0RilovwXrU0RC4XxO1ecWchZtFG9+TAMMDjXnrAG+eeD+D5XpvuJpUm9Ot0/OlGe5sc/jfcwL5+SppGh7Tw3ieRBxARVkfaiL8fA5IFTd5sVMBImhw3IJMawxw5SwbsBHmwipGfMF5w4N13YO2ITyiKg0Vwvkal+2yE2I0Ri1veJv3RoFWcEw8nN+8rH/Cm7CgmqMyqa+CZ/Ke1GRJIdxOzv9ZpNhL+HzkEZROxyQx3e12zI9CxqHUTUFTLhxv7ANJiQm2ooFuNedSckykPQIlXB6dZa3hs9AF1sPMCYyRkbaVqc6NEt90DGX2o6WnWAQhgmUl+rc3qVTcg2dy9D9Po4JMn+B+PXXjRPIfir5GaxCsNAuQqZ7SEqHyED11B/5qCaQcqH/g==\nhost:localhost:8080\nconnection:close\naccept-encoding:gzip, deflate\nuser-agent:Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)\naccept: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&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;queryString&#34;</span>:<span class="code-snippet__string">&#34;&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;marks&#34;</span>:<span class="code-snippet__string">&#34;&#34;</span>,</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__string">&#34;body&#34;</span>:<span class="code-snippet__string">&#34;&#34;</span></span></code><code><span class="code-snippet_outer">    },</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;appName&#34;</span>:<span class="code-snippet__string">&#34;null&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;metaInfo&#34;</span>:<span class="code-snippet__string">&#34;rce-algorithm-1.1.2-2023-06-30T15:00:36Z&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;stackTrace&#34;</span>:<span class="code-snippet__string">&#34;java.lang.UNIXProcess.forkAndExec(UNIXProcess.java),java.lang.UNIXProcess.&lt;init&gt;(UNIXProcess.java:247),java.lang.ProcessImpl.start(ProcessImpl.java:134),java.lang.ProcessBuilder.start(ProcessBuilder.java:1029),x.Test1188778292502339.&lt;init&gt;(Test1188778292502339.java),sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method),sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62),sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45),java.lang.reflect.Constructor.newInstance(Constructor.java:423),com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getTransletInstance(TemplatesImpl.java:457),com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:485),sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62),sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43),java.lang.reflect.Method.invoke(Method.java:498),org.apache.commons.collections.functors.InvokerTransformer.transform(InvokerTransformer.java:126),org.apache.commons.collections.map.LazyMap.get(LazyMap.java:158),org.apache.commons.collections.keyvalue.TiedMapEntry.getValue(TiedMapEntry.java:74),org.apache.commons.collections.keyvalue.TiedMapEntry.hashCode(TiedMapEntry.java:121),java.util.HashMap.hash(HashMap.java:339),java.util.HashMap.readObject(HashMap.java:1413),sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62),sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43),java.lang.reflect.Method.invoke(Method.java:498),java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1185),java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2256),java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2147),java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646),java.io.ObjectInputStream.readObject(ObjectInputStream.java:482),java.io.ObjectInputStream.readObject(ObjectInputStream.java:440),org.apache.shiro.io.DefaultSerializer.deserialize(DefaultSerializer.java:77),org.apache.shiro.mgt.AbstractRememberMeManager.deserialize(AbstractRememberMeManager.java:514),org.apache.shiro.mgt.AbstractRememberMeManager.convertBytesToPrincipals(AbstractRememberMeManager.java:431),org.apache.shiro.mgt.AbstractRememberMeManager.getRememberedPrincipals(AbstractRememberMeManager.java:396),org.apache.shiro.mgt.DefaultSecurityManager.getRememberedIdentity(DefaultSecurityManager.java:604),org.apache.shiro.mgt.DefaultSecurityManager.resolvePrincipals(DefaultSecurityManager.java:492),org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:342),org.apache.shiro.subject.Subject<span class="code-snippet__variable">$Builder</span>.buildSubject(Subject.java:846),org.apache.shiro.web.subject.WebSubject<span class="code-snippet__variable">$Builder</span>.buildWebSubject(WebSubject.java:148),org.apache.shiro.web.servlet.AbstractShiroFilter.createSubject(AbstractShiroFilter.java:292),org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:359),org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166),org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100),org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166),org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93),org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166),org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201),org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166),org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202),org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96),org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526),org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139),org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92),org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74),org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343),org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367),org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65),org.apache.coyote.AbstractProtocol<span class="code-snippet__variable">$ConnectionHandler</span>.process(AbstractProtocol.java:860),org.apache.tomcat.util.net.NioEndpoint<span class="code-snippet__variable">$SocketProcessor</span>.doRun(NioEndpoint.java:1591),org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49),java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149),java.util.concurrent.ThreadPoolExecutor<span class="code-snippet__variable">$Worker</span>.run(ThreadPoolExecutor.java:624),org.apache.tomcat.util.threads.TaskThread<span class="code-snippet__variable">$WrappingRunnable</span>.run(TaskThread.java:61),java.lang.Thread.run(Thread.java:748)&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;payload&#34;</span>:<span class="code-snippet__string">&#34;/bin/sh -cpwd&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;isBlocked&#34;</span>:<span class="code-snippet__literal">false</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;attackType&#34;</span>:<span class="code-snippet__string">&#34;\u547d\u4ee4\u6267\u884c&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;algorithm&#34;</span>:<span class="code-snippet__string">&#34;rce token contains in http headers&#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;extend&#34;</span>:<span class="code-snippet__string">&#34; &#34;</span>,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;attackTime&#34;</span>:1688137406351,</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__string">&#34;level&#34;</span>:80</span></code><code><span class="code-snippet_outer">}</span></code></pre><p style="margin-bottom: 0px;"><br/></p><p style="margin-bottom: 0px;">官网地址：https://www.jrasp.com</p><p>开源地址:   <span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"> https://github.com/jvm-rasp</span><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>




]]></content:encoded>
      <pubDate>Fri, 30 Jun 2023 23:13:16 +0800</pubDate>
    </item>
    <item>
      <title>JRASP v1.1.1 开源以及v1.1.2 版本特性说明</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484537&amp;idx=1&amp;sn=685e5c2542d18d52596bf3b058cb3baf</link>
      <description>最近半年，JRASP新版本在甲方内部不断迭，经过性能、功能和稳定性等测试，达到可用标准。</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2023-05-04 22:26</span> <span style="display: inline-block;">上海</span>
</p>

<p>最近半年，JRASP新版本在甲方内部不断迭，经过性能、功能和稳定性等测试，达到可用标准。</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=41e8eeda&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYPib1P3HCiav8HqlyGkuhO8K9NQw7HfibV1B2YukAEqnwckgeuqWhFOFicsF5wo7Sm2m1jlfE1ZTFYicag%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">     最近半年，JRASP新版本在甲方内部不断迭，经过性能、功能和稳定性等测试，达到可用标准。</p><p style="margin-bottom: 0px;"><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;color: rgb(26, 173, 25);font-size: 24px;word-wrap: break-word !important;">01</span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;letter-spacing: 0px;color: rgb(26, 173, 25);font-size: 20px;word-wrap: break-word !important;">—</span></p><p style="margin-bottom: 0px;"><br/></p><p style="max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;margin-bottom: 0px;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;margin-bottom: 0px;"><span style="max-width: 100%;font-size: 20px;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;">v1.1.1 四大主要特性</span></span></p><p style="max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;margin-bottom: 0px;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;margin-bottom: 0px;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><strong>01.模块安全加密</strong></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">在1.1.1版本之前，模块的策略算法以及配置都是明文，很容易被反编译，RASP自身的安全性不高。业内常用的提高RASP代码安全性的方式是<strong>代码混淆</strong>，但是混淆后的代码无法debug，对于排查问题非常不便。      </p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">JRASP使用对称加密方式保障模块的安全性，模块磁盘加密在运行时有模块专属类加载器解密，极大的提高了代码的安全性。另外，为了降低加密成本，提供了maven插件，用户仅需要设置加密密钥即可一键打包。详情参考：<a target="_blank" href="http://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484522&amp;idx=1&amp;sn=46380939eefe8ea6f42d2fb666acceda&amp;chksm=c03c8a7bf74b036d5801a17953692c7c3a5a8d2eef09efe5c48befb6b0802fe12026cdf1a0b1&amp;scene=21#wechat_redirect" textvalue="JRASP v1.1.1 新特性之插件运行时解密技术" linktype="text" imgurl="" imgdata="null" data-itemshowtype="0" tab="innerlink" data-linktype="2">JRASP v1.1.1 新特性之插件运行时解密技术</a></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><strong>02.组件轻量化<br/></strong></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">在之前版本，管理端和daemon之间依赖配置中心nacos、日志组件 kafka等，这些组件往往需要集群部署才能保证可靠性，部署成本较高。在当前版本中，守护进程与管理端建立websocket通信链路，用来传递配置和心跳数据。日志传输由filebeat使用http方式传递给管理端，省去了中间的kafka等中间过程。仅需要一台机器(2核4g)即可以部署jrasp，支持的agent达到万级别。<br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"><br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><strong>03.管理端使用golang重构<br/></strong></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"><br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;">使用SpringBoot构建管理端，资源占用几个GB，而实现相同功能，golang 仅需几百MB。并且Java框架潜在漏洞风险较高，所以在新的版本中抛弃了<span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;">SpringBoot</span>框架（<span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"></span>Java </span>），使用gin 框架（Golang） 重构客户端功能。性能和安全性得到较大提升。<br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"><br/></span></p><p><strong>04.新增/加强检测模块<br/></strong></p><p><br/></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p>新增内存马检测模块，该功能由 <span style="text-decoration: underline;color: rgb(0, 0, 0);">@hycsxs</span> 等提供。内存检测模块，采用行为检测算法（无规则算法），经过多种内存马检测工具验证（冰蝎哥斯拉），具备较强的检测能力。<br/></p></li></ul><p><br/></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p>加强SQL注入检测模块。sql注入检测模块在druid防火墙基础上，增加了词法分析检测， 具备较强的难饶过能力。<strong><br/></strong></p></li></ul><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="max-width: 100%;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;"><br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;color: rgb(26, 173, 25);font-size: 24px;word-wrap: break-word !important;">02</span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;letter-spacing: 0px;color: rgb(26, 173, 25);font-size: 20px;word-wrap: break-word !important;">—</span><br style="max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;font-size: 20px;box-sizing: border-box !important;word-wrap: break-word !important;">v1.1.2 新特性说明<br/></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><ul style="list-style-type: square;" class="list-paddingleft-1"><li><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;">日志功能加强。jrasp日志传输当前强依赖于filebeat，并且在容器环境filebeat不太合适。1.1.2版本将所有日志不落盘，日志传输通过rasp自身能力实现，不依赖第三方组件，进一步减少系统依赖。</p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p></li><li><p style="max-width: 100%;min-height: 1em;box-sizing: border-box !important;word-wrap: break-word !important;">支持宿主机对容器内的Java进程注入。大多数场景下，宿主机/物理机上既有容器又有java进程，场景较为复杂。当前普遍的做法是在宿主机上部署一套rasp，然后在容器内也安装一套rasp，安装多套对系统的资源压力较大。较为正确的做法是，rasp安装在宿主机层面同时支持容器/java进程注入。困难点：容器内文件与宿主机隔离、对容器内的java进程识别与注入、模块文件更新等。上面的几个困难点，目前均已经攻克，实施方法也是业内首创。（经过验证之后，计划2023年10月开源）</p></li></ul><p style="max-width: 100%;min-height: 1em;box-sizing: border-box !important;word-wrap: break-word !important;"><br/></p><p style="max-width: 100%;min-height: 1em;box-sizing: border-box !important;word-wrap: break-word !important;">jrasp 官方网站：<strong><span style="text-decoration: underline;">https://www.jrasp.com</span></strong><br/></p><p style="margin-bottom: 0px;"> 开源项目：<span style="text-decoration: underline;"><strong>https://github.com/jvm-rasp</strong></span><br/></p><p style="margin-bottom: 0px;"><br/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>




]]></content:encoded>
      <pubDate>Thu, 04 May 2023 22:26:09 +0800</pubDate>
    </item>
    <item>
      <title>JRASP v1.1.1 新特性之插件运行时解密技术</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484522&amp;idx=1&amp;sn=46380939eefe8ea6f42d2fb666acceda</link>
      <description>&#34;打铁还需自身硬&#34;，JRASP在防护业务安全的同时，也十分重视自身安全性建设。JRASP的防护策略(</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2023-02-05 22:32</span> <span style="display: inline-block;">江苏</span>
</p>

<p>"打铁还需自身硬"，JRASP在防护业务安全的同时，也十分重视自身安全性建设。JRASP的防护策略(</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=bab5fcaf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYNmN6ZnzC9V59fXepkgVDvZYWH0RJiadKY07XRK6WNwmBicOL3EBC48adB9CRQ6zPxz8ZibuXoICK7ibA%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.199999809265137px;text-align: start;background-color: rgb(255, 255, 255);">    &#34;打铁还需自身硬&#34;，JRASP在防护业务安全的同时，也十分重视自身安全性建设。JRASP的防护策略(包括hook类、参数检测逻辑等) 仍然一定程度上于依赖信息不对称，如何保障策略在传输过程、运行时不被恶意窃取分析是一个重要问题。 JRASP对整个通信链路进行了加密，包括：</span><br/></p><ul style="text-align: start;white-space: normal;padding-left: 1.2em;line-height: 1.7;caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.199999809265137px;background-color: rgb(255, 255, 255);" class="list-paddingleft-1"><li><p>管理端下发给守护进程的的安全策略加密；</p></li><li><p>守护进程与agent通信的socket加密，防止插件被控制；</p></li><li><p>插件jar包传输全过程加密，在类加载时解密，最大程度防止jar包被反编译；</p></li></ul><p><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.199999809265137px;text-align: start;background-color: rgb(255, 255, 255);">    上面的第1、2点易实现，技术难点不高，因此本文将介绍第三点<strong>运行时类加密解密技术</strong>。</span><br/></p><p><strong><span style="caret-color: rgb(44, 62, 80);font-size: 20px;background-color: rgb(255, 255, 255);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;text-align: start;">1.编译时加密一般原理</span></strong><br/></p><p style="text-align: start;"><span style="color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;caret-color: rgb(44, 62, 80);background-color: rgb(255, 255, 255);font-size: 15px;">    下面为java 对称加密基本实现代码。对于一个编译好的 class 文件，调用加密算法，将class 文件转为密文即可。<span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span></span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer">    <span class="code-snippet__comment">/**</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * AES 加密</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     *</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * <span class="code-snippet__doctag">@param</span> content 待加密内容</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * <span class="code-snippet__doctag">@param</span> aesKey  密码</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * <span class="code-snippet__doctag">@return</span></span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     */</span></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">static</span> <span class="code-snippet__keyword">byte</span>[] encrypt(<span class="code-snippet__keyword">byte</span>[] content, String aesKey) {</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">if</span> (aesKey == <span class="code-snippet__keyword">null</span> || aesKey.length() != <span class="code-snippet__number">16</span>) {</span></code><code><span class="code-snippet_outer">            <span class="code-snippet__keyword">return</span> <span class="code-snippet__keyword">null</span>;</span></code><code><span class="code-snippet_outer">        }</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">try</span> {</span></code><code><span class="code-snippet_outer">            <span class="code-snippet__keyword">byte</span>[] bytes = aesKey.getBytes(<span class="code-snippet__string">&#34;UTF-8&#34;</span>);</span></code><code><span class="code-snippet_outer">            SecretKeySpec skeySpec = <span class="code-snippet__keyword">new</span> SecretKeySpec(bytes, <span class="code-snippet__string">&#34;AES&#34;</span>);</span></code><code><span class="code-snippet_outer">            Cipher cipher = Cipher.getInstance(<span class="code-snippet__string">&#34;AES/ECB/PKCS5Padding&#34;</span>);</span></code><code><span class="code-snippet_outer">            cipher.init(Cipher.ENCRYPT_MODE, skeySpec);</span></code><code><span class="code-snippet_outer">            <span class="code-snippet__keyword">return</span> cipher.doFinal(content);</span></code><code><span class="code-snippet_outer">        } <span class="code-snippet__keyword">catch</span> (Exception e) {</span></code><code><span class="code-snippet_outer">            <span class="code-snippet__keyword">throw</span> <span class="code-snippet__keyword">new</span> RuntimeException(e);</span></code><code><span class="code-snippet_outer">        }</span></code><code><span class="code-snippet_outer">    }</span></code></pre><p style="text-align: start;">       <span style="font-size: 15px;"> jrasp安全</span><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">插件以 jar 包形式输出，以 file-hook 模块为例子，将 jar 解压后，<strong>com.jrasp.agent.module </strong>包下的类需要加密，目标加密文件是<span style="text-align: start;">FileHook.class </span>（jar包依赖的三方包，如工具类，可以不加密）。<span style="display: none;line-height: 0px;">‍‍‍‍‍‍‍‍</span></span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="1.1555075593952484" data-s="300,640" data-type="png" data-w="926" style="width: 478px;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=60269c1f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNmN6ZnzC9V59fXepkgVDvZCoksaSPnysctymPZL9x5lx915Fep10o82iahzfu6SmVzBKoOmwfbdEg%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: start;"><strong><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 20px;text-align: start;background-color: rgb(255, 255, 255);">2.编译加密maven plugin 插件</span></strong></p><p style="text-align: start;"><span style="color:#2c3e50;font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;"><span style="caret-color: rgb(44, 62, 80);background-color: rgb(255, 255, 255);font-size: 15px;">    为了更友好的将加密逻辑嵌入打包编译流程中，避免繁琐的jar包解压、加密class文件、压缩jar包等流程。jrasp 官方将加密逻辑写入到了</span><span style="color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;text-align: start;caret-color: rgb(44, 62, 80);background-color: rgb(255, 255, 255);font-size: 15px;">maven plugin 插件中，插件代码在jrasp-agent 项目下的 <strong>jrasp-encrypt </strong>工程中。并且无需其他配置，仅需要在 bin/DECRYPT_KEY.txt 中配置 加密/解密 密钥即可，简化操作。<span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span></span></span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.6638497652582159" data-s="300,640" data-type="png" data-w="2130" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=86eab27a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNmN6ZnzC9V59fXepkgVDvZPta7NhXMYiaDTGZAckmpibKC8VMtM2GuujB6VwLImkQdtcL8G14bemAQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: left;"><span style="font-size: 15px;">    jrasp-module 工程引入加密插件，并且配置插件参数配置：密钥文件路径和需要加密包(多个包，逗号分隔)</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.4670846394984326" data-s="300,640" data-type="png" data-w="1914" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=f94208bd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNmN6ZnzC9V59fXepkgVDvZ0PGjL6rzibTpibDxptszuRDkzibV3u4d9gIaEDuXEt65J5ywl3oYBiadvw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: start;"><strong><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 20px;text-align: start;background-color: rgb(255, 255, 255);">3.运行时解密</span></strong></p><p style="text-align: start;"><span style="font-size: 15px;">    jrasp 采用自定义类加载器加载jar包，在类加载器的<strong>loadClass<span style="font-size: 15px;text-align: start;">环节</span></strong>（类加载器的该方法作用可以参考其他博文）（class 文件流转换为 class 对象过程），将加密后二进制文件解密为jvm可以识别的class文件。<span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span></span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span></p><p style="text-align: start;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5474903474903475" data-s="300,640" data-type="png" data-w="2590" style="text-align: center;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=4b813758&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNmN6ZnzC9V59fXepkgVDvZO7wo7d3icAlFJB34pWybr2LY5sVHBC5Mw9vtUfyYojwMpD15Zc0oboA%2F640%3Fwx_fmt%3Dpng"/><br/></p><p style="text-align: left;"><span style="font-size: 15px;">class 解密的技术实现细节：</span><span style="display: none;line-height: 0px;">‍</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.7001102535832414" data-s="300,640" data-type="png" data-w="1814" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=47a72b88&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNmN6ZnzC9V59fXepkgVDvZymRrM5WVRiaEF72icnCoIU9kfaDyaHX5z9yTmjTsZH72cE8pGT5Evnrw%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: start;"><strong style="text-align: start;white-space: normal;"><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 20px;background-color: rgb(255, 255, 255);">4.加密算法与密钥保存分发</span></strong></p><p style="text-align: start;"><span style="font-size: 15px;"><strong style="text-align: start;white-space: normal;"><span style="font-size: 15px;caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;background-color: rgb(255, 255, 255);">    1.加密算法的选择：<span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span></span></strong></span></p><p style="text-align: start;"><span style="font-size: 15px;caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;background-color: rgb(255, 255, 255);">        由于 jrasp 要兼容不同的jdk版本，不同jdk版本加密算法差异较大，兼容性存在很大问题，考虑兼容性，这里 jrasp 采用了对称加密。（如果业务指为特定jdk如openjdk，可以采用该jdk支持的非对称加密）。</span></p><p style="text-align: start;"><span style="font-size: 15px;caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;background-color: rgb(255, 255, 255);"><strong style="font-size: 15px;text-align: start;white-space: normal;"><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;background-color: rgb(255, 255, 255);">    2.密钥的保存：</span></strong></span></p><p style="text-align: start;"><span style="font-size: 15px;caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;background-color: rgb(255, 255, 255);"><strong style="font-size: 15px;text-align: start;white-space: normal;"><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;background-color: rgb(255, 255, 255);">    </span></strong><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;background-color: rgb(255, 255, 255);">为了保障加密的安全性，密钥理论上是不允许明文配置在conf文件中（配置文件密钥容易泄漏）。密钥jrasp-daemon 编译时固化到可执行文件中。并且密钥与jrasp-daemon 可执行文件的md5一一对应，保证无法篡改。</span><strong style="font-size: 15px;text-align: start;white-space: normal;"><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;background-color: rgb(255, 255, 255);"><br/></span></strong></span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.4584269662921348" data-s="300,640" data-type="png" data-w="2670" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=1f2fee05&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNmN6ZnzC9V59fXepkgVDvZtnxApOrOQ5hpmNq43sk65bdV25IK8AfhaSrTL3kmksFOlQ08OQxF5g%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: start;"><strong style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15px;text-align: start;white-space: normal;background-color: rgb(255, 255, 255);">    3.密钥的分发给：</strong></p><p style="text-align: start;"><span style="font-size: 15px;">   jrasp-daemon 通过attach 机制动态传递给 java agent。<span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;"></span></span></p><p style="text-align: start;"><span style="color:#2c3e50;font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;"><span style="caret-color: rgb(44, 62, 80);font-size: 15.199999809265137px;background-color: rgb(255, 255, 255);"><strong style="text-align: start;white-space: normal;"><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 20px;background-color: rgb(255, 255, 255);">5.总结<span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span></span></strong></span></span></p><p style="text-align: start;"><span style="color:#2c3e50;font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;"><span style="caret-color: rgb(44, 62, 80);font-size: 15.199999809265137px;background-color: rgb(255, 255, 255);">   jrasp 目前是业内唯一采用运行时加密算法保障安全策略的rasp。安全策略jar包磁盘加密，运行时解密，密钥不落盘。大大提高了rasp自身的安全性。<span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span><span style="display: none;line-height: 0px;">‍</span></span></span></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>




]]></content:encoded>
      <pubDate>Sun, 05 Feb 2023 22:32:09 +0800</pubDate>
    </item>
    <item>
      <title>JRASP 1.1.0 功能特性以及安装使用</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484512&amp;idx=1&amp;sn=311abdad04f1f07fee7bce36bed17de3</link>
      <description>“ 🔥🔥🔥国内技术领先的开源RASP社区”    jrasp 从1.0.4 (2019年) 迭代至今，历经多</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2022-12-11 17:20</span> <span style="display: inline-block;">江苏</span>
</p>

<p>“ 🔥🔥🔥国内技术领先的开源RASP社区”    jrasp 从1.0.4 (2019年) 迭代至今，历经多</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=35905f24&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYPW2oWRUPo2AVDMJcYo8omJlYGlfOlGS69ENmuYcPdhoeo2oPMseUph2ibIOsooO4RNcMjydvAkYkA%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<pre style="text-align: start;background-color: rgb(255, 255, 255);font-family: &#34;JetBrains Mono&#34;, monospace;"><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><strong style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;color: rgb(136, 136, 136);font-size: 20px;box-sizing: border-box !important;word-wrap: break-word !important;">“</span></strong><span style="max-width: 100%;color: rgb(136, 136, 136);font-size: 14px;box-sizing: border-box !important;word-wrap: break-word !important;"> </span><span style="caret-color: rgb(106, 139, 173);font-family: -apple-system, BlinkMacSystemFont, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;text-align: center;background-color: rgb(255, 255, 255);max-width: 100%;color: rgb(136, 136, 136);font-size: 16px;box-sizing: border-box !important;word-wrap: break-word !important;">🔥🔥🔥国内技术领先的开源RASP社区<strong style="caret-color: rgb(136, 136, 136);color: rgb(136, 136, 136);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 16px;text-align: start;white-space: normal;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;font-size: 20px;box-sizing: border-box !important;word-wrap: break-word !important;">”</span></strong></span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">    jrasp 从1.0.4 (2019年) 迭代至今，历经多个版本，1.1.0在原有基础上功能、性能和安全性等方面得到较大提升。</span></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;margin-bottom: 0px;"><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;color: rgb(26, 173, 25);font-size: 24px;word-wrap: break-word !important;">01</span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;letter-spacing: 0px;color: rgb(26, 173, 25);font-size: 20px;word-wrap: break-word !important;">—</span></p><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);text-align: center;margin-bottom: 0px;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="font-size: 20px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;">功能特性<span style="display: none;line-height: 0px;">‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍</span></span></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/><span style="display: none;line-height: 0px;">‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍</span></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p><p style="font-size: 16px;text-align: center;"><img class="rich_pages wxw-img" data-backh="496" data-backw="558" data-galleryid="" data-ratio="0.8881578947368421" data-s="300,640" data-type="png" data-w="1520" style="width: 100%;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=b8adfc68&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPW2oWRUPo2AVDMJcYo8omJsgnXZfs6zniaVKibcpicqibeyIIhick1YK9z6icicibyYtn8ZF37xoohWSExcQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><strong><span style="font-size: 15px;">特性说明</span></strong><span style="font-size: 15px;">：</span><br/></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="font-size: 15px;"><br/></span></p><ul class="list-paddingleft-1" style="list-style-type: disc;"><li style="font-size: 15px;"><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="font-size: 15px;"><span style="font-size: 15px;caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;text-align: start;background-color: rgb(255, 255, 255);">三方依赖更少(仅ASM)、体积更小(核心包仅600KB)</span>功能更加全面；</span></p></li><li style="font-size: 15px;"><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="font-size: 15px;">新增http检测模块、ssrf模块、jndi模块等；</span></p></li><li style="font-size: 15px;"><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="font-size: 15px;">提供 windows 系统安装包；</span></p></li><li style="font-size: 15px;"><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="font-size: 15px;">提供 attach 工具，方便手动测试jrasp-agent功能</span></p></li></ul><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="font-size: 15px;">版本迭代：<strong><span style="text-decoration: underline;"><em><span style="text-decoration: underline;">https://www.jrasp.com/guide/technology/changelog.html</span></em></span></strong></span></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;color: rgb(26, 173, 25);font-size: 24px;word-wrap: break-word !important;">02</span></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;letter-spacing: 0px;color: rgb(26, 173, 25);font-size: 20px;word-wrap: break-word !important;">—</span><br style="max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;text-align: center;word-wrap: break-word !important;"><span style="font-size: 20px;">安装使用</span></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><span style="font-size: 15px;">安装须知：</span></p><ul class="list-paddingleft-1" style="list-style-type: disc;"><li style="font-size: 15px;"><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"><span style="font-size: 15px;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;text-align: start;background-color: rgb(255, 255, 255);">jrasp 在腾讯云/阿里云上部署了jrasp的基础设施，</span>仅需要安装jrasp-agent，即可接入到jrasp云端管控平台，快速体验jrasp功能!!</span></p></li><li style="font-size: 15px;"><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"><span style="font-size: 15px;">仅需2行命令即可以完成安装！！</span></p></li><li style="font-size: 15px;"><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"><span style="font-size: 15px;">仅限centos操作系统</span></p></li><li style="font-size: 15px;"><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"><span style="font-size: 15px;">使用 root 权限安装</span></p></li></ul><p><br/></p><p style="font-size: 16px;max-width: 100%;box-sizing: border-box;min-height: 1em;word-wrap: break-word !important;"><strong>第一步 安装 agent</strong><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">curl https:<span class="code-snippet__comment">//jrasp-download.oss-cn-shanghai.aliyuncs.com/jrasp-install.sh|bash</span></span></code></pre><p style="text-align: start;background-color: rgb(255, 255, 255);font-family: &#34;JetBrains Mono&#34;, monospace;padding-right: 10px;padding-left: 10px;max-width: 100%;box-sizing: border-box;line-height: 1.6;color: rgb(62, 62, 62);white-space: normal;margin-bottom: 0px;word-wrap: break-word !important;">安装成功后如下：<br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;padding-right: 22px;padding-left: 22px;line-height: 1.6;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;word-wrap: break-word !important;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.4076517150395778" data-s="300,640" data-type="png" data-w="1516" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=c2107075&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPW2oWRUPo2AVDMJcYo8omJW9nkk5SriaRyZZbf94k8QuCPyMDrGLsWJFxXYnJHSA8VU7RUPRq3a1g%2F640%3Fwx_fmt%3Dpng"/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;padding-right: 22px;padding-left: 22px;line-height: 1.6;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;word-wrap: break-word !important;"><br/></p><p style="max-width: 100%;box-sizing: border-box;min-height: 1em;padding-right: 22px;padding-left: 22px;line-height: 1.6;color: rgb(62, 62, 62);font-size: 16px;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;word-wrap: break-word !important;">    注意：安装目录在/usr/local/jrasp 下,如果已经安装过1.0.8及以下版本，请先将`jrasp`目录删除再安装。</p><p style="color: rgb(0, 0, 0);"><br/></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;margin-bottom: 0px;"><strong style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 16px;text-align: start;white-space: normal;">第二步 安装 filebeat </strong></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;"><br/></p><p style="text-align: start;background-color: rgb(255, 255, 255);font-family: &#34;JetBrains Mono&#34;, monospace;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">(此步骤非必需，如果是内网环境/无法访问公网，可以跳过)</span></p><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">curl https:<span class="code-snippet__comment">//jrasp-download.oss-cn-shanghai.aliyuncs.com/filebeat-install.sh|bash</span></span></code></pre><p><span style="display: none;line-height: 0px;">‍</span><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">filebeat 的作用是收集 jrasp-agent的日志。</span></p><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">安装成功之后：</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.20400943396226415" data-s="300,640" data-type="png" data-w="1696" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=e05c7480&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPW2oWRUPo2AVDMJcYo8omJAvhu0BbicwgW7j3C0fwqNfvs9wb0BWFWQCpLJNYMCUGyoZIHKzYV49g%2F640%3Fwx_fmt%3Dpng"/></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;"><br/></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;"><br/></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;"><strong style="font-family: &#34;JetBrains Mono&#34;, monospace;text-align: start;caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-size: 16px;white-space: normal;">第三步 </strong><span style="font-size: 16px;"><strong style="font-family: &#34;JetBrains Mono&#34;, monospace;text-align: start;caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-size: 16px;white-space: normal;"><span style="white-space: pre-wrap;caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);font-family: &#34;JetBrains Mono&#34;, monospace;text-align: start;background-color: rgb(255, 255, 255);">登陆管理端</span> </strong></span></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;"><span style="font-size: 16px;"><strong style="font-family: &#34;JetBrains Mono&#34;, monospace;text-align: start;caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-size: 16px;white-space: normal;"><br/></strong></span></p><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">(此步骤非必需，如果是内网环境/无法访问公网，可以跳过)</span></p><ul class="list-paddingleft-1" style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><li style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">云端管控平台地址：http://132.232.32.246</span></p></li><li style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">用户名称：user2022 密码：123456</span></p></li><li style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">在实例管理中查看是agent否成功注册</span></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;"><span style="font-size: 15px;display: none;line-height: 0px;">‍</span></p><p style="color: rgb(0, 0, 0);font-size: 9.8pt;"><span style="display: none;line-height: 0px;">‍</span></p></li></ul><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="309" data-backw="578" data-galleryid="" data-ratio="0.5344947735191637" data-s="300,640" data-type="png" data-w="2870" style="width: 100%;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=916156aa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPW2oWRUPo2AVDMJcYo8omJ5GMO3m7pdyrUrfviaj0LicqL4Z4xs1d6o6iakmllp5hPGb1AWV5eAiccBg%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;"><br/></p><p style="max-width: 100%;box-sizing: border-box;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;color: rgb(26, 173, 25);font-size: 24px;word-wrap: break-word !important;">03</span></p><p style="max-width: 100%;box-sizing: border-box;text-align: center;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;letter-spacing: 0px;color: rgb(26, 173, 25);font-size: 20px;word-wrap: break-word !important;">—</span><br style="max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"/></p><p style="margin-bottom: 0px;caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;white-space: normal;max-width: 100%;box-sizing: border-box;text-align: center;word-wrap: break-word !important;"><span style="font-size: 20px;">单机版本</span></p><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">    如果是内网环境/无法访问公网，无法链接到管理端，可以使用jrasp官方提供的工具`attach`，手动执行注入、参数/模块更新、hook类查看和卸载等功能。</span></p><p style="color: rgb(62, 62, 62);font-size: 16px;max-width: 100%;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);margin-bottom: 0px;text-align: start;font-family: &#34;JetBrains Mono&#34;, monospace;box-sizing: border-box !important;word-wrap: break-word !important;"><span style="caret-color: rgb(62, 62, 62);color: rgb(62, 62, 62);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 15px;text-align: start;background-color: rgb(255, 255, 255);">  在完成 jrasp-agent安装之后，安装目录下提供了attach工具。‍‍‍‍‍‍‍功能使用参考文档：https://www.jrasp.com/guide/install/single.html</span></p></pre><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://www.jrasp.com/guide/install/saas.html">阅读原文</a></p>
]]></content:encoded>
      <pubDate>Sun, 11 Dec 2022 17:20:00 +0800</pubDate>
    </item>
    <item>
      <title>线程注入与JRASP实践</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484499&amp;idx=1&amp;sn=a5808d12ba14f17afab4b73c79f4dd37</link>
      <description>任意代码执行漏洞中，攻击者通过开启一个新的线程来执行命令时，rasp丢失请求的上下文、执行堆栈等重要参数，导致检测算法（堆栈算法、ip黑名单、请求参数特征等无法关联）失效，极大的影响RASP的防御功能与溯源能力。</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2022-10-04 10:25</span> <span style="display: inline-block;">江苏</span>
</p>

<p>任意代码执行漏洞中，攻击者通过开启一个新的线程来执行命令时，rasp丢失请求的上下文、执行堆栈等重要参数，导致检测算法（堆栈算法、ip黑名单、请求参数特征等无法关联）失效，极大的影响RASP的防御功能与溯源能力。</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=6ec7f22e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYPXjXPJgd4FSHaFOk5FfjfZyYf8d7pgoKkyUCfrOHVpGCnxe4go7pVFayA2FQdicm7uOsIiclIvrvyg%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<pre style="text-align: start;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 9.8pt;">    任意代码执行漏洞中，攻击者通过开启一个新的线程来执行命令时，rasp丢失请求的上下文、执行堆栈等重要参数，导致检测算法（堆栈算法、请求参数特征等无法关联）失效，极大的影响RASP的防御功能与溯源能力。<br/><p><span style="font-size: 20px;">01 案例</span><br/></p><p>    如下案例：http 请求线程执行到下面的代码时，新建一个新的线程来执行任意，命令，http特征参数丢失。</p></pre><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="typescript"><code><span class="code-snippet_outer">&lt;%@ page language=<span class="code-snippet__string">&#34;java&#34;</span> contentType=<span class="code-snippet__string">&#34;text/html; charset=UTF-8&#34;</span></span></code><code><span class="code-snippet_outer">    pageEncoding=<span class="code-snippet__string">&#34;UTF-8&#34;</span>%&gt;</span></code><code><span class="code-snippet_outer">    &lt;%@ page <span class="code-snippet__keyword">import</span>=<span class="code-snippet__string">&#34;java.io.IOException&#34;</span> %&gt;</span></code><code><span class="code-snippet_outer">DOCTYPE html&gt;</span></code><code><span class="code-snippet_outer">&lt;html&gt;</span></code><code><span class="code-snippet_outer">&lt;head&gt;</span></code><code><span class="code-snippet_outer">&lt;meta charset=<span class="code-snippet__string">&#34;UTF-8&#34;</span>&gt;</span></code><code><span class="code-snippet_outer">&lt;title&gt;Insert title heretitle&gt;</span></code><code><span class="code-snippet_outer">head&gt;</span></code><code><span class="code-snippet_outer">&lt;body&gt;</span></code><code><span class="code-snippet_outer">&lt;%</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__comment">// 创建线程执行命令，而不是直接执行命令</span></span></code><code><span class="code-snippet_outer">    Thread t = <span class="code-snippet__keyword">new</span> Thread(<span class="code-snippet__keyword">new</span> Runnable() {</span></code><code><span class="code-snippet_outer">            <span class="code-snippet__meta">@Override</span>         </span></code><code><span class="code-snippet_outer">            <span class="code-snippet__keyword">public</span> <span class="code-snippet__built_in">void</span> run() {             </span></code><code><span class="code-snippet_outer">              <span class="code-snippet__keyword">try</span> {</span></code><code><span class="code-snippet_outer">                Runtime.getRuntime().exec(<span class="code-snippet__keyword">new</span> <span class="code-snippet__built_in">String</span>[]{<span class="code-snippet__string">&#34;touch&#34;</span>,<span class="code-snippet__string">&#34;/tmp/test&#34;</span>});             </span></code><code><span class="code-snippet_outer">              } <span class="code-snippet__keyword">catch</span> (IOException e) {</span></code><code><span class="code-snippet_outer">                 e.printStackTrace();</span></code><code><span class="code-snippet_outer">              }</span></code><code><span class="code-snippet_outer">            }</span></code><code><span class="code-snippet_outer">    });</span></code><code><span class="code-snippet_outer">    t.start();</span></code><code><span class="code-snippet_outer">    out.println(<span class="code-snippet__string">&#34;&gt;==test==&lt;&#34;</span>);</span></code><code><span class="code-snippet_outer">%&gt;</span></code><code><span class="code-snippet_outer">body&gt;</span></code><code><span class="code-snippet_outer">html&gt;</span></code></pre><pre style="text-align: start;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 9.8pt;">    RASP最终截获的参数会丢失http，无法溯源。（实现原理上的缺陷）<br/><p><br/></p><br/><p><strong><span style="font-size: 20px;">02 参数丢失原因与优化措施</span></strong></p><p><span style="font-size: 20px;"><br/></span></p>    rasp 中使用 <span style="color: rgb(128, 128, 128);font-style: italic;">ThreadLocal </span>在线程的不同hook点处传递http等参数，由于无法跨线程，参数必然丢失。<br/>    有更好的线程关联类，来解决上面新建线程参数丢失问题：<span style="color: rgb(128, 128, 128);font-style: italic;">java.lang.InheritableThreadLocal</span>类。<br/></pre><blockquote class="js_blockquote_wrap" data-type="2" data-url="" data-author-name="" data-content-utf8-length="226" data-source-title="" data-text="Inheritable thread-local variables are used in preference to ordinary thread-local variables when the per-thread-attribute being maintained in the variable (e.g., User ID, Transaction ID) must be automatically transmitted to any child threads that are created." data-editid="u62ahfoej740000000"><p>Inheritable thread-local variables are used in preference to ordinary thread-local variables when the per-thread-attribute being maintained in the variable (e.g., User ID, Transaction ID) must be automatically transmitted to any child threads that are created.</p></blockquote><pre style="text-align: start;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 9.8pt;">    实现原理：在父线程创建子线程时，向子线程传递变量。可以参考:<span style="color: rgb(0, 0, 255);">[InheritableThreadLocal]</span>(<span style="font-style: italic;">https://www.jianshu.com/p/94ba4a918ff5</span>)。<br/><strong><span style="font-size: 20px;">03 JRASP实现</span></strong><span style="color: rgb(102, 14, 122);font-weight: bold;font-style: italic;"><br/></span><p><br/></p><ul class="list-paddingleft-1" style="list-style-type: square;"><li><p>使用<span style="color: rgb(128, 128, 128);font-style: italic;">InheritableThreadLocal</span>创建线程变量</p></li></ul></pre><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer"><span class="code-snippet__comment">// 线程上下文                                                                                              </span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">// 上下文增强：使用 InheritableThreadLocal 代替 ThreadLocal 防止线程注入                                              </span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">static</span> InheritableThreadLocal&lt;Context&gt; requestContext = <span class="code-snippet__keyword">new</span> InheritableThreadLocal&lt;Context&gt;() {</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__meta">@Override</span>                                                                                         </span></code><code><span class="code-snippet_outer">    <span class="code-snippet__function"><span class="code-snippet__keyword">protected</span> Context <span class="code-snippet__title">initialValue</span><span class="code-snippet__params">()</span> </span>{                                                                </span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">return</span> <span class="code-snippet__keyword">new</span> Context();                                                                         </span></code><code><span class="code-snippet_outer">    }                                                                                                 </span></code><code><span class="code-snippet_outer">};</span></code><code><span class="code-snippet_outer"> </span></code><code><span class="code-snippet_outer"> <span class="code-snippet__comment">// 模块中使用线程上下文</span></span></code><code><span class="code-snippet_outer"> <span class="code-snippet__meta">@RaspResource</span></span></code><code><span class="code-snippet_outer"> <span class="code-snippet__keyword">private</span> ThreadLocal&lt;Context&gt; context;</span></code></pre><pre style="text-align: start;"><ul class="list-paddingleft-1" style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-size: 9.8pt;list-style-type: square;"><li><p>线程变量的清除<br/></p></li></ul><p style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-size: 9.8pt;"><br/></p><p style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-size: 9.8pt;">    由于jrasp的基本特征是热卸载（加载），如果不能清除线程变量，将会导致已经加载的 jrasp-agent/module 无法正常卸载，造成比较严重的内存泄漏。<br/>    因此，jrasp-agent 在卸载时, 执行<span style="color: rgb(255, 0, 0);text-decoration: underline;"><strong>强制清除</strong></span>线程变量操作，彻底解决内存泄漏问题；<br/></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="php"><code><span class="code-snippet_outer"> <span class="code-snippet__comment">// 除去 context 线程变量                                                                                                                            </span></span></code><code><span class="code-snippet_outer"> <span class="code-snippet__keyword">List</span>&lt;Thread&gt; threadList = ThreadUtil.getThreadList();                                                                                         </span></code><code><span class="code-snippet_outer"> <span class="code-snippet__keyword">for</span> (Thread thread : threadList) {                                                                                                            </span></code><code><span class="code-snippet_outer">     <span class="code-snippet__comment">/**                                                                                                                                       </span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">      * 在 rasp 退出时清理线程变量，这里使用 inheritableThreadLocals 应该清除 inheritableThreadLocals                                                             </span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">      * <span class="code-snippet__doctag">@see</span> Thread.inheritableThreadLocals                                                                                                    </span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">      * <span class="code-snippet__doctag">@see</span> Thread.threadLocals                                                                                                               </span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">      */</span>                                                                                                                                       </span></code><code><span class="code-snippet_outer">     Object threadLocalMap = RaspReflectUtils.unCaughtGetClassDeclaredJavaFieldValue(Thread.class, <span class="code-snippet__string">&#34;inheritableThreadLocals&#34;</span>, thread);      </span></code><code><span class="code-snippet_outer">     <span class="code-snippet__keyword">if</span> (<span class="code-snippet__keyword">null</span> != threadLocalMap) {                                                                                                             </span></code><code><span class="code-snippet_outer">         <span class="code-snippet__comment">//  反射获取 ThreadLocalMap类的 remove 方法                                                                                                   </span></span></code><code><span class="code-snippet_outer">         Method method = RaspReflectUtils.unCaughtGetClassDeclaredJavaMethod(threadLocalMap.getClass(), <span class="code-snippet__string">&#34;remove&#34;</span>, ThreadLocal.class);       </span></code><code><span class="code-snippet_outer">         <span class="code-snippet__keyword">try</span> {                                                                                                                                 </span></code><code><span class="code-snippet_outer">             RaspReflectUtils.unCaughtInvokeMethod(method, threadLocalMap, requestContext);                                                 </span></code><code><span class="code-snippet_outer">         } <span class="code-snippet__keyword">catch</span> (<span class="code-snippet__keyword">Exception</span> e) {                                                                                                               </span></code><code><span class="code-snippet_outer">             e.printStackTrace();                                                                                                              </span></code><code><span class="code-snippet_outer">         }                                                                                                                                     </span></code><code><span class="code-snippet_outer">     }                                                                                                                                         </span></code><code><span class="code-snippet_outer"> }                                                                                                                                             </span></code></pre><p style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-size: 9.8pt;"><br/><strong><span style="font-size: 20px;">04 优化后演示</span></strong></p><p style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);"><span style="color:#000000;font-size:13px;">    在springboot项目中创建一个controller：</span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="typescript"><code><span class="code-snippet_outer">    <span class="code-snippet__meta">@GetMapping</span>(<span class="code-snippet__string">&#34;/get/cmd.do&#34;</span>)</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__keyword">public</span> <span class="code-snippet__built_in">void</span> getProcessBuilder(<span class="code-snippet__built_in">String</span> cmd) throws Exception {</span></code><code><span class="code-snippet_outer">        Thread thread = <span class="code-snippet__keyword">new</span> Thread(<span class="code-snippet__keyword">new</span> Runnable() {</span></code><code><span class="code-snippet_outer">            <span class="code-snippet__meta">@Override</span></span></code><code><span class="code-snippet_outer">            <span class="code-snippet__keyword">public</span> <span class="code-snippet__built_in">void</span> run() {</span></code><code><span class="code-snippet_outer">                <span class="code-snippet__keyword">try</span> {</span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__comment">// 执行命令</span></span></code><code><span class="code-snippet_outer">                    execCMD(cmd);</span></code><code><span class="code-snippet_outer">                } <span class="code-snippet__keyword">catch</span> (Exception e) {</span></code><code><span class="code-snippet_outer">                    e.printStackTrace();</span></code><code><span class="code-snippet_outer">                }</span></code><code><span class="code-snippet_outer">            }</span></code><code><span class="code-snippet_outer">        });</span></code><code><span class="code-snippet_outer">        thread.start();</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">return</span>;</span></code><code><span class="code-snippet_outer">    }</span></code></pre><p style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);"><span style="color:#000000;font-size:13px;"> 发起请求，</span><span style="color:#000000;font-size:13px;">检测结果，http 参数未丢失。</span></p><p style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);"><span style="color:#000000;font-size:13px;"></span></p><div style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);display: inline;"><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5842592592592593" data-s="300,640" data-type="png" data-w="1080" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=6aca0810&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPXjXPJgd4FSHaFOk5FfjfZeznYBuhuoyXEUV9SLZkC7QrRRjP4FkPGHVeXl27nTdic8DQD6S2yNIA%2F640%3Fwx_fmt%3Dpng"/></p></div><span style="font-family:JetBrains Mono, monospace;"><span style="background-color: rgb(255, 255, 255);"><br/></span></span><span style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-size: 13px;"> 卸载jrasp后，触发full gc，</span><span style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);color: rgb(0, 0, 0);font-size: 13px;">可以看到jvm的类卸载事件，完全卸载。</span><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="xml"><code><span class="code-snippet_outer">// 卸载jrasp</span></code><code><span class="code-snippet_outer">./attach -p <span class="code-snippet__tag">&lt;<span class="code-snippet__name">pid</span>&gt;</span> -s</span></code></pre><p style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);"><span style="color:#000000;font-size:13px;"></span></p><div style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);display: inline;"><p style="text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.47451343836886006" data-s="300,640" data-type="png" data-w="1079" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=c020fcba&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPXjXPJgd4FSHaFOk5FfjfZzvYFwMa6icsl17Cbg7LdTJCBW4DRq1Ek31RHvSVC5HhLpPI3cwCUIhQ%2F640%3Fwx_fmt%3Dpng"/></p></div><span style="font-family:JetBrains Mono, monospace;"><span style="background-color: rgb(255, 255, 255);"><br/></span></span><p style="font-family: &#34;JetBrains Mono&#34;, monospace;background-color: rgb(255, 255, 255);"><br/></p>》<span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">》</span><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">》1.1.0 </span><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">新版本功能预览，欢迎申请试用</span></pre><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="markdown"><code><span class="code-snippet_outer"><span class="code-snippet__section">### 1.1.0【2022-10】（当前开发版本）</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">#### Enhancement</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[attach] 新增jrasp-attach工程(Golang)，支持手动注入、查看hook类、更新模块参数和卸载RASP</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] agent依赖的bridge打包时指定，防止加载错误依赖</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] 去掉logback/sl4j，使用原生jul ，减少不安全的依赖</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] 去掉内置jetty，使用原生socket</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] 使用InheritableThreadLocal代替ThreadLocal防止线程注入</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] 去掉java-agent的json日志格式，并修改filebeat的日志分割grok表达式</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[module] 上下文对象优化为context对象</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[module] module统一参数更新接口</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[project] 将jrasp-agent、jrasp-module、jrasp-attach和jrasp-daemon等工程合并，统一编译打包</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[project] 全面兼容 windows、linux、mac</span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">#### BugFix</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] jar包文件名称增加版本号，解决jar包文件句柄清除问题</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[module] 替换 @Resource 注解，解决与javax包类的冲突</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] 解决jvm-sandbox抛出异常时的内存泄漏 bug （jvm-sandbox 已经合入补丁）</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[jetty module] 解决 http input.read方法重复hook问题 （在openrasp上已经复现该问题）</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[xxe module] 解决dom4j方法重复hook问题 （在openrasp官方已经确认该问题）</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">#### TODO</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] 优化类匹配机制，全局唯一transform实例，减少stw时间</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">### 1.0.8 【2022-08】（内部测试版本）</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">#### Enhancement</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[module] 增加多个安全模块</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] 进程扫描优化</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] 防止启动多个守护进程</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">### 1.0.7 【2022-07】（用户使用的稳定版本）</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">#### Enhancement</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] 上报配置更新时间</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] daemon启动上报nacos初始化的状态和注册的服务ip</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] 发现无法连接nacos时，自动重启，24小时检测一次</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">#### BugFix</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] 修复软刷新panic</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] 删除获取依赖的功能，由安全插件自行上报</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">### 1.0.6 【2022-06】</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">#### BugFix</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] 使用 os.RemoveAll 删除Java进程文件夹</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">### 1.0.5 【2022-05】</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon]插件以配置文件为准，配置文件中没有的，删除磁盘上的</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon]注入后增加软刷新功能和参数更新功能</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">### 1.0.4 【2022-04】 （开源版本）</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[agent] 增加native方法hook</span></code><code><span class="code-snippet_outer"><span class="code-snippet__bullet">+ </span>[daemon] 支持对多个Java进程注入，每个Java进程独立的数据目录</span></code></pre><p>​</p>




]]></content:encoded>
      <pubDate>Tue, 04 Oct 2022 10:25:29 +0800</pubDate>
    </item>
    <item>
      <title>RASP漏洞防御之 XXE 漏洞</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484491&amp;idx=1&amp;sn=18f6bda7535df72efd63ae6fd03208fc</link>
      <description>当应用是通过用户上传的XML文件或POST请求进行数据的传输，并且应用没有禁止XML引用外部实体，也没有过滤用户提交的XML数据，那么就会产生XML外部实体注入漏洞。</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2022-09-04 20:31</span> <span style="display: inline-block;">上海</span>
</p>

<p>当应用是通过用户上传的XML文件或POST请求进行数据的传输，并且应用没有禁止XML引用外部实体，也没有过滤用户提交的XML数据，那么就会产生XML外部实体注入漏洞。</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=53ce8748&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYOKqHZibgO0UGbmXP5x4950Xg9HobKQcGXoEnia9dGnqic2lM5vP0qE0onhln821icr72j9JY2pIr2veA%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<h2 style="font-weight: 600;line-height: 1.25;font-size: 1.55rem;padding-bottom: 0.3rem;border-bottom: 0px solid rgb(234, 236, 239);margin-top: -3.1rem;padding-top: 4.6rem;margin-bottom: 0px;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;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;">简介</h2><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;">当应用是通过用户上传的XML文件或POST请求进行数据的传输，并且应用没有禁止XML引用外部实体，也没有过滤用户提交的XML数据，那么就会产生XML外部实体注入漏洞。</p><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;">XXE 漏洞在owasp2021中位置：</p><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;">A05:2021 – Security Misconfiguration <span style="font-weight: 600;">CWE-611</span> Improper Restriction of XML External Entity Reference（XXE）</p><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;"><span style="font-size: 1.55rem;font-weight: 600;">防护</span><br/></p><blockquote class="js_blockquote_wrap" data-type="2" data-url="" data-author-name="" data-content-utf8-length="17" data-source-title="" data-text="使用语言中推荐的禁用外部实体的方法" data-editid="o0w46wgdmr4y9jihhc"><p>使用语言中推荐的禁用外部实体的方法</p></blockquote><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;">这里以 Java 语言为例子说明。</p><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;">使用XML库的Java应用程序特别容易受到XXE攻击，因为大多数Java XML解析器的<strong style="font-weight: 600;">默认设置是启用XXE</strong>。为了安全地使用这些解析器，必须在使用的解析器中显式禁用XXE。下面描述如何在最常用的Java XML解析器中禁用XXE。</p><p style="margin: 0px 0px 24px;padding: 0px;clear: both;min-height: 1em;color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;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;"><span style="margin: 0px;padding: 0px;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 1.35rem;font-weight: 600;text-align: start;">01.DocumentBuilderFactory</span></p><p style="margin: 0px 0px 24px;padding: 0px;clear: both;min-height: 1em;color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;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;">javax.xml.parsers.DocumentBuilderFactory</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();</span></code><code><span class="code-snippet_outer"><span class="code-snippet__built_in">String</span> FEATURE = <span class="code-snippet__literal">null</span>;</span></code><code><span class="code-snippet_outer">FEATURE = <span class="code-snippet__string">&#34;http://apache.org/xml/features/disallow-doctype-decl&#34;</span>;</span></code><code><span class="code-snippet_outer">dbf.setFeature(FEATURE, <span class="code-snippet__literal">true</span>);</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">FEATURE = <span class="code-snippet__string">&#34;http://xml.org/sax/features/external-general-entities&#34;</span>;</span></code><code><span class="code-snippet_outer">dbf.setFeature(FEATURE, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">FEATURE = <span class="code-snippet__string">&#34;http://xml.org/sax/features/external-parameter-entities&#34;</span>;</span></code><code><span class="code-snippet_outer">dbf.setFeature(FEATURE, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">FEATURE = <span class="code-snippet__string">&#34;http://apache.org/xml/features/nonvalidating/load-external-dtd&#34;</span>;</span></code><code><span class="code-snippet_outer">dbf.setFeature(FEATURE, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">dbf.setXIncludeAware(<span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer">dbf.setExpandEntityReferences(<span class="code-snippet__literal">false</span>);</span></code></pre><p><span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 1.35rem;font-weight: 600;text-align: start;">02.Dom4j</span></p><p><strong><span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;text-align: start;">org.dom4j.io.SAXReader</span></strong></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">saxReader.setFeature(<span class="code-snippet__string">&#34;http://apache.org/xml/features/disallow-doctype-decl&#34;</span>, <span class="code-snippet__literal">true</span>);</span></code><code><span class="code-snippet_outer">saxReader.setFeature(<span class="code-snippet__string">&#34;http://xml.org/sax/features/external-general-entities&#34;</span>, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer">saxReader.setFeature(<span class="code-snippet__string">&#34;http://xml.org/sax/features/external-parameter-entities&#34;</span>, <span class="code-snippet__literal">false</span>);</span></code></pre><h3 style="font-weight: 600;line-height: 1.25;font-size: 1.35rem;margin-top: -3.1rem;padding-top: 4.6rem;margin-bottom: 0px;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;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;">03.Jdom</h3><h3 style="font-weight: 600;line-height: 1.25;font-size: 1.35rem;margin-top: -3.1rem;padding-top: 4.6rem;margin-bottom: 0px;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;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;"><span style="font-size: 15px;">org.jdom2.input.SAXBuilder、 org.jdom.input.SAXBuilder</span></h3><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">SAXBuilder builder = <span class="code-snippet__keyword">new</span> SAXBuilder();</span></code><code><span class="code-snippet_outer">builder.setFeature(<span class="code-snippet__string">&#34;http://apache.org/xml/features/disallow-doctype-decl&#34;</span>,<span class="code-snippet__literal">true</span>);</span></code><code><span class="code-snippet_outer">builder.setFeature(<span class="code-snippet__string">&#34;http://xml.org/sax/features/external-general-entities&#34;</span>, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer">builder.setFeature(<span class="code-snippet__string">&#34;http://xml.org/sax/features/external-parameter-entities&#34;</span>, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer">builder.setExpandEntities(<span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer">Document doc = builder.build(<span class="code-snippet__keyword">new</span> File(fileName));</span></code></pre><h3 style="font-weight: 600;line-height: 1.25;font-size: 1.35rem;margin-top: -3.1rem;padding-top: 4.6rem;margin-bottom: 0px;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;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;">04.XMLInputFactory</h3><p><strong style="margin: 0px;padding: 0px;color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: justify;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;"><span style="margin: 0px;padding: 0px;font-size: 15px;color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;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;">javax.xml.stream.XMLInputFactory</span></strong></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer"><span class="code-snippet__comment">// This disables DTDs entirely for that factory</span></span></code><code><span class="code-snippet_outer">xmlInputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">// This causes XMLStreamException to be thrown if external DTDs are accessed.</span></span></code><code><span class="code-snippet_outer">xmlInputFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, <span class="code-snippet__string">&#34;&#34;</span>);</span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">// disable external entities</span></span></code><code><span class="code-snippet_outer">xmlInputFactory.setProperty(<span class="code-snippet__string">&#34;javax.xml.stream.isSupportingExternalEntities&#34;</span>, <span class="code-snippet__literal">false</span>);</span></code></pre><h3 style="font-weight: 600;line-height: 1.25;font-size: 1.35rem;margin-top: -3.1rem;padding-top: 4.6rem;margin-bottom: 0px;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;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;">05.XMLReader</h3><p><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">org.xml.sax.XMLReader</span><br/></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">XMLReader reader = XMLReaderFactory.createXMLReader();</span></code><code><span class="code-snippet_outer">reader.setFeature(<span class="code-snippet__string">&#34;http://apache.org/xml/features/disallow-doctype-decl&#34;</span>, <span class="code-snippet__literal">true</span>);</span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">// This may not be strictly required as DTDs shouldn&#39;t be allowed at all, per previous line.</span></span></code><code><span class="code-snippet_outer">reader.setFeature(<span class="code-snippet__string">&#34;http://apache.org/xml/features/nonvalidating/load-external-dtd&#34;</span>, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer">reader.setFeature(<span class="code-snippet__string">&#34;http://xml.org/sax/features/external-general-entities&#34;</span>, <span class="code-snippet__literal">false</span>);</span></code><code><span class="code-snippet_outer">reader.setFeature(<span class="code-snippet__string">&#34;http://xml.org/sax/features/external-parameter-entities&#34;</span>, <span class="code-snippet__literal">false</span>);</span></code></pre><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;"><span style="font-size: 1.55rem;font-weight: 600;">RASP防护</span><br/></p><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;">上面的修复方式在具体实施时存在缺陷：</p><ul style="padding-left: 1.2em;line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;" class="list-paddingleft-1"><li><p>如果读取xml的代码在第三方包中（或者依赖框架），一般很难直接修改，必须pr框架/包提供者来修复；</p><p><br/></p></li></ul><p style="line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;">这里以dom4j为例子来说RASP如何修复XX漏洞</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer"><span class="code-snippet__keyword">package</span> com.example.controller;</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> org.dom4j.Document;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> org.dom4j.Element;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> org.dom4j.io.SAXReader;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> org.springframework.http.ResponseEntity;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> org.springframework.web.bind.annotation.PostMapping;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> org.springframework.web.bind.annotation.RequestMapping;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> org.springframework.web.bind.annotation.RestController;</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">import</span> java.io.ByteArrayInputStream;</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__meta">@RestController</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__meta">@RequestMapping</span>(<span class="code-snippet__string">&#34;/xxe/dom4j&#34;</span>)</span></code><code><span class="code-snippet_outer"><span class="code-snippet__keyword">public</span> <span class="code-snippet__class"><span class="code-snippet__keyword">class</span> <span class="code-snippet__title">Dom4jController</span> </span>{</span></code><code><span class="code-snippet_outer">    </span></code><code><span class="code-snippet_outer">    <span class="code-snippet__meta">@PostMapping</span>(<span class="code-snippet__string">&#34;/post/dom4j.do&#34;</span>)</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__function"><span class="code-snippet__keyword">public</span> ResponseEntity&lt;String&gt; <span class="code-snippet__title">documentBuilder1</span><span class="code-snippet__params">(String xml, <span class="code-snippet__keyword">int</span> fix)</span> <span class="code-snippet__keyword">throws</span> Exception </span>{</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">return</span> ResponseEntity.ok(dom4j(xml, fix));</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__function"><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">static</span> String <span class="code-snippet__title">dom4j</span><span class="code-snippet__params">(String xml, <span class="code-snippet__keyword">int</span> fix)</span> <span class="code-snippet__keyword">throws</span> Exception </span>{</span></code><code><span class="code-snippet_outer">        SAXReader saxReader = <span class="code-snippet__keyword">new</span> SAXReader();</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__comment">// 启用修复方式</span></span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">if</span> (fix == <span class="code-snippet__number">1</span>) {</span></code><code><span class="code-snippet_outer">            saxReader.setFeature(<span class="code-snippet__string">&#34;http://apache.org/xml/features/disallow-doctype-decl&#34;</span>, <span class="code-snippet__keyword">true</span>);</span></code><code><span class="code-snippet_outer">            saxReader.setFeature(<span class="code-snippet__string">&#34;http://xml.org/sax/features/external-general-entities&#34;</span>, <span class="code-snippet__keyword">false</span>);</span></code><code><span class="code-snippet_outer">            saxReader.setFeature(<span class="code-snippet__string">&#34;http://xml.org/sax/features/external-parameter-entities&#34;</span>, <span class="code-snippet__keyword">false</span>);</span></code><code><span class="code-snippet_outer">            saxReader.setFeature(<span class="code-snippet__string">&#34;http://apache.org/xml/features/nonvalidating/load-external-dtd&#34;</span>, <span class="code-snippet__keyword">false</span>);</span></code><code><span class="code-snippet_outer">        }</span></code><code><span class="code-snippet_outer">        ByteArrayInputStream byteArrayInputStream = <span class="code-snippet__keyword">new</span> ByteArrayInputStream(xml.getBytes());</span></code><code><span class="code-snippet_outer">        Document document = saxReader.read(byteArrayInputStream);</span></code><code><span class="code-snippet_outer">        Element element = document.getRootElement();</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">return</span> element.getText();</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">}</span></code><code><span class="code-snippet_outer"><br/></span></code></pre><blockquote class="js_blockquote_wrap" data-type="2" data-url="" data-author-name="" data-content-utf8-length="7" data-source-title="" data-text="dom4j版本" data-editid="bb9os9ovhiwjdmueps"><p>dom4j版本</p></blockquote><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="xml"><code><span class="code-snippet_outer"> <span class="code-snippet__tag">&lt;<span class="code-snippet__name">dependency</span>&gt;</span></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__tag">&lt;<span class="code-snippet__name">groupId</span>&gt;</span>org.dom4j<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">groupId</span>&gt;</span></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__tag">&lt;<span class="code-snippet__name">artifactId</span>&gt;</span>dom4j<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">artifactId</span>&gt;</span></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__tag">&lt;<span class="code-snippet__name">version</span>&gt;</span>2.0.0<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">version</span>&gt;</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__tag">&lt;/<span class="code-snippet__name">dependency</span>&gt;</span></span></code></pre><p><span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 1.35rem;font-weight: 600;text-align: start;">POC</span><br/></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="xml"><code><span class="code-snippet_outer">curl --location --request POST &#39;http://localhost:8080/xxe/dom4j/post/dom4j.do&#39; \</span></code><code><span class="code-snippet_outer">--header &#39;Content-Type: application/x-www-form-urlencoded&#39; \</span></code><code><span class="code-snippet_outer">--data-urlencode &#39;xml=<span class="code-snippet__meta">&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&gt;</span><span class="code-snippet__meta">&lt;!DOCTYPE root [&lt;!ENTITY xxe SYSTEM &#34;file:///etc/passwd&#34;&gt;]&gt;</span><span class="code-snippet__tag">&lt;<span class="code-snippet__name">root</span>&gt;</span>&amp;xxe;<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">root</span>&gt;</span>&#39; \</span></code><code><span class="code-snippet_outer">--data-urlencode &#39;fix=0&#39;</span></code></pre><p><span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">读取 </span><code style="font-family: source-code-pro, Menlo, Monaco, Consolas, &#34;Courier New&#34;, monospace;color: rgb(71, 101, 130);padding: 0.25rem 0.5rem;margin: 0px;font-size: 0.85em;background-color: rgba(27, 31, 35, 0.05);border-radius: 3px;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;">/etc/passwd</code><span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">文本内容</span></p><p><span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;"><span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">返回结果：</span></span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer"><span class="code-snippet__comment">##</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># User Database</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># </span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># Note that this file is consulted directly only when the system is running</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># in single-user mode.  At other times this information is provided by</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># Open Directory.</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">#</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># See the opendirectoryd(8) man page for additional information about</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># Open Directory.</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">##</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__symbol">nobody:</span>*<span class="code-snippet__symbol">:-</span><span class="code-snippet__number">2</span><span class="code-snippet__symbol">:-</span><span class="code-snippet__number">2</span><span class="code-snippet__symbol">:Unprivileged</span> <span class="code-snippet__symbol">User:</span>/var/<span class="code-snippet__symbol">empty:</span>/usr/bin/<span class="code-snippet__literal">false</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__symbol">root:</span>*<span class="code-snippet__symbol">:</span><span class="code-snippet__number">0</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">0</span><span class="code-snippet__symbol">:System</span> <span class="code-snippet__symbol">Administrator:</span>/var/<span class="code-snippet__symbol">root:</span>/bin/sh</span></code><code><span class="code-snippet_outer"><span class="code-snippet__symbol">daemon:</span>*<span class="code-snippet__symbol">:</span><span class="code-snippet__number">1</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">1</span><span class="code-snippet__symbol">:System</span> <span class="code-snippet__symbol">Services:</span>/var/<span class="code-snippet__symbol">root:</span>/usr/bin/<span class="code-snippet__literal">false</span></span></code><code><span class="code-snippet_outer">...</span></code><code><span class="code-snippet_outer"><br/></span></code></pre><h3 style="font-weight: 600;line-height: 1.25;font-size: 1.35rem;margin-top: -3.1rem;padding-top: 4.6rem;margin-bottom: 0px;color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;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;">模块插件举例</h3><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer">    <span class="code-snippet__comment">/**</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * read重载方法最终调用 read(InputSource)</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     *</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * <span class="code-snippet__doctag">@see</span> org.dom4j.io.SAXReader#read(InputSource)</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     */</span></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__function"><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">closeDom4jXXE</span><span class="code-snippet__params">()</span> </span>{</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">final</span> String className = <span class="code-snippet__string">&#34;org.dom4j.io.SAXReader&#34;</span>;</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">final</span> String methdName = <span class="code-snippet__string">&#34;read&#34;</span>;</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">new</span> EventWatchBuilder(moduleEventWatcher)</span></code><code><span class="code-snippet_outer">                .onClass(className)</span></code><code><span class="code-snippet_outer">                .includeBootstrap()</span></code><code><span class="code-snippet_outer">                .onBehavior(methdName)</span></code><code><span class="code-snippet_outer">                .withParameterTypes(<span class="code-snippet__string">&#34;org.xml.sax.InputSource&#34;</span>)</span></code><code><span class="code-snippet_outer">                .onWatch(<span class="code-snippet__keyword">new</span> AdviceListener() {</span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__meta">@Override</span></span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__function"><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">before</span><span class="code-snippet__params">(Advice advice)</span> <span class="code-snippet__keyword">throws</span> Throwable </span>{</span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__keyword">if</span> (!enableCheck) {</span></code><code><span class="code-snippet_outer">                            <span class="code-snippet__keyword">return</span>;</span></code><code><span class="code-snippet_outer">                        }</span></code><code><span class="code-snippet_outer">                        SAXReader saxReader = (SAXReader) advice.getTarget();</span></code><code><span class="code-snippet_outer">                        saxReader.setFeature(FEATURE_DEFAULTS_1, <span class="code-snippet__keyword">true</span>);</span></code><code><span class="code-snippet_outer">                        saxReader.setFeature(FEATURE_DEFAULTS_2, <span class="code-snippet__keyword">false</span>);</span></code><code><span class="code-snippet_outer">                        saxReader.setFeature(FEATURE_DEFAULTS_3, <span class="code-snippet__keyword">false</span>);</span></code><code><span class="code-snippet_outer">                    }</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__meta">@Override</span></span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__function"><span class="code-snippet__keyword">protected</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">afterThrowing</span><span class="code-snippet__params">(Advice advice)</span> <span class="code-snippet__keyword">throws</span> Throwable </span>{</span></code><code><span class="code-snippet_outer">                        requestInfoThreadLocal.remove();</span></code><code><span class="code-snippet_outer">                    }</span></code><code><span class="code-snippet_outer">                });</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer"><br/></span></code></pre><p>    需要注意的是，<span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">JRASP 对Dom4j的hook类做了进一步的优化，hook了更加底层的方法（如下所示）。</span></p><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="swift"><code><span class="code-snippet_outer"><span class="code-snippet__keyword">public</span> <span class="code-snippet__type">Document</span> read(<span class="code-snippet__type">InputSource</span> <span class="code-snippet__keyword">in</span>) <span class="code-snippet__keyword">throws</span> <span class="code-snippet__type">DocumentException</span></span></code></pre><p><span style="font-size: 14px;background-color: rgb(255, 255, 255);color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;text-align: start;">（经过debug和实际dump字节码发现，open-rasp 存在重复插桩、防护逻辑执行两次的问题。相关issue：https://github.com/baidu/openrasp/issues/396）</span></p><p><span style="background-color: rgb(255, 255, 255);color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;text-align: start;">选取hook类一般是十分慎重，必须了解hook类的功能，选取类的一般性原则如下：</span><span style="color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;"></span></p><ul class="list-paddingleft-1" style="list-style-type: disc;"><li><p><span style="background-color: rgb(255, 255, 255);color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;text-align: start;">能防护漏洞；</span></p></li><li><p><span style="background-color: rgb(255, 255, 255);color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;text-align: start;">选取更底层方法，避免被被绕过；</span></p></li><li><p><span style="background-color: rgb(255, 255, 255);color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;text-align: start;">在保证功能的基础上hook类尽量少；</span></p><p><span style="background-color: rgb(255, 255, 255);color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;text-align: start;"><br/></span></p></li></ul><p><span style="background-color: rgb(255, 255, 255);color: rgb(44, 62, 80);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;text-align: start;">目前JRASP已经具备上面5类常用XML解析器的漏洞防护插件。</span></p><p>----------------------------------------------------------------------------</p><p><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">XXE漏洞案例：</span><br/></p><p>https://www.jrasp.com/case/CVE-2018-15531.html</p><p>https://www.jrasp.com/case/CVE-2018-1259.html</p><p>​​</p>



<p><a href="http://www.jrasp.com/algorithm/xxe/xxe.html">阅读原文</a></p>
]]></content:encoded>
      <pubDate>Sun, 04 Sep 2022 20:30:51 +0800</pubDate>
    </item>
    <item>
      <title>RASP| Apache Spark Shell(CVE-2022-33891)</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484482&amp;idx=1&amp;sn=5df912a24492a1c3be497a005720057c</link>
      <description>Apache Spark UI提供了通过配置选项Spark.acl.enable启用acl的可能性。使用身份验证过滤器，这将检查用户是否具有查看或修改应用程序的访问权限。</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2022-08-14 11:09</span> <span style="display: inline-block;">上海</span>
</p>

<p>Apache Spark UI提供了通过配置选项Spark.acl.enable启用acl的可能性。使用身份验证过滤器，这将检查用户是否具有查看或修改应用程序的访问权限。</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=41f5de98&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYNhkAUu5H1q6pE8lv6CMCTvTyeaiaSYjsC8DsdtS0U796DgMqpXjPksuFf9ODCzaibh1T7ZRCoicWfdg%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p>    <span style="font-size: 17px;">Apache发布安全公告，修复了一个Apache Spark中存在的命令注入漏洞。漏洞编号：CVE-2022-33891，漏洞威胁等级：高危。    Apache Spark UI提供了通过配置选项Spark.acl.enable启用acl的可能性。使用身份验证过滤器，这将检查用户是否具有查看或修改应用程序的访问权限。<br/>    如果启用了acl，HttpSecurityFilter中的代码路径可以允许某人通过提供任意用户名来执行模拟。恶意用户可能能够访问权限检查功能，该功能最终将根据他们的输入构建一个UnixShell命令并执行它。这将导致任意 shell 命令执行。</span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;">    影响版本如下：</p><ul style="list-style-type: square;" class="list-paddingleft-1"><li><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;">Spark Core - Apache &lt;=3.0.3</p></li><li><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;">3.1.1 &lt;= Spark Core - Apache &lt;=3.1.2</p></li><li><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;">3.2.0 &lt;= Spark Core - Apache &lt;=3.2.1<br/></p></li></ul><p><strong mp-original-font-size="14" mp-original-line-height="22.399999618530273" style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;outline: 0px;max-width: 100%;line-height: 22.4px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;">环境搭建</span></strong></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;">    </span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-size: 17px;">下载 <span style="font-size: 17px;color: rgb(0, 0, 255);">Apache Spark 3.2.1</span> </span></p><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer"><span class="code-snippet__symbol">https:</span>/<span class="code-snippet__regexp">/repo.huaweicloud.com/apache</span><span class="code-snippet__regexp">/spark/spark</span>-<span class="code-snippet__number">3.2</span>.<span class="code-snippet__number">1</span>/spark-<span class="code-snippet__number">3.2</span>.<span class="code-snippet__number">1</span>-bin-hadoop2.<span class="code-snippet__number">7</span>.tgz</span></code></pre><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br/></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;"><img class="rich_pages wxw-img" data-ratio="0.42493638676844786" data-type="png" data-w="786" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=df5988c1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNhkAUu5H1q6pE8lv6CMCTvdJzPONgLkBTphFwSZ0g9JLNsqFeha5ekYmf6xaDPWjHHFgOFJYlj2g%2F640%3Fwx_fmt%3Dpng"/></span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;"><br/></span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;"><br/></span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;">    漏洞触发的关键在于是否启用ACL，使用身份验证过滤器。启用ACL的方式：1、通过设置选项 spark.acls.enable 启用 。2、运行spark-shell时，通过-c（--conf）参数启动。<br/></span></p><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">./spark-shell --conf spark.acls.enable=<span class="code-snippet__literal">true</span></span></code></pre><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br/></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;"><img class="rich_pages wxw-img" data-ratio="0.4878048780487805" data-type="png" data-w="902" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=52716b60&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNhkAUu5H1q6pE8lv6CMCTvFHhvOeqXobx7ApOruHcHezXO4Nliaw7XAP8vNN9BJRkhYWZJEnkoagA%2F640%3Fwx_fmt%3Dpng"/></span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;"><br/></span></p><span style="color: rgb(34, 34, 34);font-family: system-ui, -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(34, 34, 34);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;"></span><p><strong mp-original-font-size="14" mp-original-line-height="22.399999618530273" style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;outline: 0px;max-width: 100%;line-height: 22.4px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;">漏洞复现</span></strong></p><br/><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-ratio="0.4023193577163247" data-type="png" data-w="1121" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=f1038f24&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNhkAUu5H1q6pE8lv6CMCTvdqx5IhtTlXyCuVzibyjjJDOJxWC6WqJj0ReWmNibQhgQjeNYiay2j9N5Q%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;"><br/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;">管理端：</p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;"><img class="rich_pages wxw-img" data-ratio="0.5432969852469531" data-type="png" data-w="1559" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=1bc0f194&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNhkAUu5H1q6pE8lv6CMCTvEGzQbFctSS43wMlwdvXws16qTn5AsEibEcSFNpWn29lLiaheIQ1creuA%2F640%3Fwx_fmt%3Dpng"/><br/></p><br/><p><strong mp-original-font-size="14" mp-original-line-height="22.399999618530273" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;font-size: 14px;line-height: 22.4px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;">补充说明<br mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;"/></span></strong></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;clear: both;min-height: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;outline: 0px;max-width: 100%;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-size-adjust: auto;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br/></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;clear: both;min-height: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;outline: 0px;max-width: 100%;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-size-adjust: auto;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;">     spark-ui内置jetty处理http请求，并且使用 shade 打包方式修改了 jetty 包的前缀。rasp一般hook的jetty类全限定名称：</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="css"><code><span class="code-snippet_outer"><span class="code-snippet__selector-tag">org</span><span class="code-snippet__selector-class">.eclipse</span><span class="code-snippet__selector-class">.jetty</span><span class="code-snippet__selector-class">.server</span><span class="code-snippet__selector-class">.Server</span></span></code><code><span class="code-snippet_outer"><br/></span></code></pre><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;clear: both;min-height: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;outline: 0px;max-width: 100%;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-size-adjust: auto;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;">而 spark-ui中该类的名称</p><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="css"><code><span class="code-snippet_outer"><span class="code-snippet__selector-tag">org</span><span class="code-snippet__selector-class">.sparkproject</span><span class="code-snippet__selector-class">.jetty</span><span class="code-snippet__selector-class">.server</span><span class="code-snippet__selector-class">.Server</span></span></code></pre><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;clear: both;min-height: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;outline: 0px;max-width: 100%;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-size-adjust: auto;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;">     对于这种场景，RASP必然丢失http参数。<span style="letter-spacing: 0.544px;">为了解决上面的问题，传统RASP需要修改代码，即：</span><span style="letter-spacing: 0.544px;">增加hook类、打包编译agent、重新发布、推动业务进程重启的流程（需要重启升级）；</span><span style="letter-spacing: 0.544px;">而 jrasp 仅需要新增 hook 模块，无需重启业务，下发立即生效。</span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;clear: both;min-height: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;outline: 0px;max-width: 100%;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-size-adjust: auto;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="letter-spacing: 0.544px;">    spark-jetty-hook <span style="caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;display: inline !important;float: none;">模块</span>部分代码：<br/></span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer">    <span class="code-snippet__comment">/**</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * 1.重置绑定在线程上的线程本地变量，防止线程脏数据；</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * 2.绑定本次请求信息；</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     * 3.如果请求逻辑没有走到这里，将出现脏数据</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">     */</span></span></code><code><span class="code-snippet_outer">    <span class="code-snippet__function"><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">jettyRequestPreHook</span><span class="code-snippet__params">()</span> </span>{</span></code><code><span class="code-snippet_outer">        <span class="code-snippet__keyword">new</span> EventWatchBuilder(moduleEventWatcher)</span></code><code><span class="code-snippet_outer">                .onClass(<span class="code-snippet__string">&#34;org.sparkproject.jetty.server.Server&#34;</span>)</span></code><code><span class="code-snippet_outer">                .includeBootstrap()</span></code><code><span class="code-snippet_outer">                .onBehavior(<span class="code-snippet__string">&#34;handle&#34;</span>)</span></code><code><span class="code-snippet_outer">                .withParameterTypes(<span class="code-snippet__string">&#34;org.sparkproject.jetty.server.HttpChannel&#34;</span>)</span></code><code><span class="code-snippet_outer">                .onWatch(<span class="code-snippet__keyword">new</span> AdviceListener() {</span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__meta">@Override</span></span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__function"><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">before</span><span class="code-snippet__params">(Advice advice)</span> <span class="code-snippet__keyword">throws</span> Throwable </span>{</span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__keyword">if</span> (!enableCheck) {</span></code><code><span class="code-snippet_outer">                            <span class="code-snippet__keyword">return</span>;</span></code><code><span class="code-snippet_outer">                        }</span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__comment">// 清除上次请求的 requestInfo 信息,防止脏数据</span></span></code><code><span class="code-snippet_outer">                        requestInfoThreadLocal.remove();</span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__comment">// 绑定本次请求的请求头</span></span></code><code><span class="code-snippet_outer">                        Object httpChannel = advice.getParameterArray()[<span class="code-snippet__number">0</span>];</span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__keyword">if</span> (httpChannel == <span class="code-snippet__keyword">null</span>) {</span></code><code><span class="code-snippet_outer">                            <span class="code-snippet__keyword">return</span>;</span></code><code><span class="code-snippet_outer">                        }</span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__keyword">if</span> (getRequest == <span class="code-snippet__keyword">null</span>) {</span></code><code><span class="code-snippet_outer">                            getRequest = httpChannel.getClass().getMethod(<span class="code-snippet__string">&#34;getRequest&#34;</span>);</span></code><code><span class="code-snippet_outer">                        }</span></code><code><span class="code-snippet_outer">                        Object httpRequest = ReflectUtils.invokeMethod(getRequest, httpChannel);</span></code><code><span class="code-snippet_outer">                        HashMap&lt;String, Object&gt; context = requestInfoThreadLocal.get();</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__comment">// 俘虏HttpServletRequest参数为傀儡</span></span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__keyword">final</span> IHttpServletRequest httpServletRequest = puppet(IHttpServletRequest.class, httpRequest);</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">                        storeRequestInfo(context, httpServletRequest);</span></code><code><span class="code-snippet_outer">                    }</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__meta">@Override</span></span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__function"><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">void</span> <span class="code-snippet__title">afterThrowing</span><span class="code-snippet__params">(Advice advice)</span> <span class="code-snippet__keyword">throws</span> Throwable </span>{</span></code><code><span class="code-snippet_outer">                        <span class="code-snippet__comment">// 代码执行异常情况清除 context 信息，防止内存泄漏</span></span></code><code><span class="code-snippet_outer">                        requestInfoThreadLocal.remove();</span></code><code><span class="code-snippet_outer">                    }</span></code><code><span class="code-snippet_outer">                });</span></code><code><span class="code-snippet_outer">    }</span></code></pre><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><br/></p><p style="margin: 0px 0px 24px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;">-----------------------------------------------------------------------</p><p style="margin: 0px 0px 24px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-variant-ligatures: normal;orphans: 2;text-align: center;widows: 2;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;float: none;font-size: 15px;color: rgb(0, 0, 0);display: inline !important;">🔥🔥🔥国内技术领先的开源RASP社区  </span><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;text-decoration: underline;">https://www.jrasp.com</span></p>



<p><a href="https://www.jrasp.com/case/CVE-2022-33891.html">阅读原文</a></p>
]]></content:encoded>
      <pubDate>Sun, 14 Aug 2022 11:09:29 +0800</pubDate>
    </item>
    <item>
      <title>RASP| SQL注入检测与防御</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484458&amp;idx=1&amp;sn=d4d656eb02cbb7fccd0f4b8b785e1da1</link>
      <description>最近表达式注入的漏洞较多，jrasp 目前已经支持spel/ognl 表达式的检测。</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2022-07-30 20:03</span> <span style="display: inline-block;">上海</span>
</p>

<p>最近表达式注入的漏洞较多，jrasp 目前已经支持spel/ognl 表达式的检测。</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=042576d4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZFhoON5ic4NaYbH992KFSiaicx77HfY1kyyLcXuDAqsLuclVWg1Qia3ovUA%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;font-variant-ligatures: normal;orphans: 2;widows: 2;margin-bottom: 24px;"><span style="font-size: 20px;">    </span><span style="font-size: 17px;">一方面<span style="font-size: 17px;color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;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;float: none;display: inline !important;">数</span>据映射框架如mybatis、hiberate等在框架底层已经实现了对sql注入的防御，另一方面白盒/黑盒等扫描器也能解决一部分sql注入问题，sql注入的出现风险被大大降低。但是在研发人员未能恰当的使用框架或者sql语句拼接不当的的情况下，仍然可能导致sql注入的风险。本文分析sql注入的几种情况以及RASP在其中的作用。</span></p><p style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;font-variant-ligatures: normal;orphans: 2;widows: 2;margin-bottom: 24px;"><strong><span style="font-size: 20px;">1.JDBC 拼接不当造成的SQL注入</span></strong><span style="font-size: 20px;"></span></p><p><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">    </span><span style="font-size: 17px;">JDBC有两种方法执行SQL语句，分别为PrepareStatement和Statement。两个方法的区别在于PrepareStatement会对SQL语句进行预编译，而Statement方法在每次执行时都需要编译，会增大系统开销。理论上PrepareStatement的效率和安全性会比Statement要好，但并不意味着使用PrepareStatement就绝对安全，不会产生SQL注入。</span></p><p>      PrepareStatement方法支持使用‘?’对变量位进行占位，在预编译阶段填入相应的值构造出完整的SQL语句，此时可以避免SQL注入的产生。但开发者有时为了便利，会直接采取拼接的方式构造SQL语句，此时进行预编译则无法阻止SQL注入的产生。如以下代码所示，PrepareStatement虽然进行了预编译，但在以拼接方式构造SQL语句的情况下仍然会产生SQL注入。代码示例如下（若使用“or 1=1”，仍可判断出这段代码存在SQL注入）</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">String sql = &#34;<span class="code-snippet__keyword">select</span> * <span class="code-snippet__keyword">from</span> <span class="code-snippet__keyword">user</span> <span class="code-snippet__keyword">where</span> <span class="code-snippet__keyword">id</span> =<span class="code-snippet__string">&#34; + req.getParameter(&#34;</span><span class="code-snippet__keyword">id</span><span class="code-snippet__string">&#34;);</span></span></code><code><span class="code-snippet_outer">out.println(sql);</span></code><code><span class="code-snippet_outer">try{</span></code><code><span class="code-snippet_outer">    PreparedStatement pstt = con.prepareStatement(sql);</span></code><code><span class="code-snippet_outer">    ResultSet re = pstt.executeQuery();</span></code><code><span class="code-snippet_outer">    while(rs.next()){</span></code><code><span class="code-snippet_outer"><span class="code-snippet_outer">        out.println(&#34;</span>&lt;br&gt;<span class="code-snippet__keyword">id</span>:<span class="code-snippet__string">&#34;+rs.getObject(&#34;</span><span class="code-snippet__keyword">id</span><span class="code-snippet__string">&#34;));</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet_outer">        out.println(&#34;</span>&lt;br&gt;<span class="code-snippet__keyword">name</span>:<span class="code-snippet__string">&#34;+re.getObject(&#34;</span><span class="code-snippet__keyword">name</span><span class="code-snippet__string">&#34;));</span></span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    catch(SQLException e){</span></code><code><span class="code-snippet_outer">        e.printStackTrace();</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">}</span></code></pre><p>     正确地使用PrepareStatement可以有效避免SQL注入的产生，使用“?”作为占位符时，填入对应字段的值会进行严格的类型检查。将前面的“拼接构造SQL语句”改为如下“使用占位符构造SQL语句”的代码片段，即可有效避免SQL注入的产生。</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">PrintWriter out = resp.getWriter();</span></code><code><span class="code-snippet_outer">String sql = &#34;<span class="code-snippet__keyword">select</span> * <span class="code-snippet__keyword">from</span> <span class="code-snippet__keyword">user</span> <span class="code-snippet__keyword">where</span> <span class="code-snippet__keyword">id</span> = ?<span class="code-snippet__string">&#34;</span></span></code><code><span class="code-snippet_outer">out.println(sql);</span></code><code><span class="code-snippet_outer">try{</span></code><code><span class="code-snippet_outer">    PreparedStatement pstt = con.prepareStatement(sql);</span></code><code><span class="code-snippet_outer"><span class="code-snippet_outer">    pstt.setInt(1,Integer.parseInt(req.getParameter(&#34;</span><span class="code-snippet__keyword">id</span><span class="code-snippet__string">&#34;)));</span></span></code><code><span class="code-snippet_outer">    ResultSet rs = pstt.executeQuery();</span></code><code><span class="code-snippet_outer">    // sql执行结果的代码省去....</span></code><code><span class="code-snippet_outer">}</span></code></pre><p style="margin-bottom: 24px;"><br/></p><p style="margin-bottom: 24px;"><span style="font-size: 20px;"><strong><span style="font-size: 20px;margin: 0px;padding: 0px;">2.</span><span style="font-size: 20px;font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">框架使用不当造成SQL注入</span></strong></span></p><p style="margin-bottom: 24px;"><strong style="color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;text-align: start;"><span style="font-size: 20px;">    </span></strong><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">如今的Java项目或多或少会使用对JDBC进行更抽象封装的持久化框架，如MyBatis和Hibernate。通常，框架底层已经实现了对SQL注入的防御，但在研发人员未能恰当使用框架的情况下，仍然可能存在SQL注入的风险。</span><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"></span></p><p><strong>Mybatis框架</strong></p><p><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">    MyBatis框架的思想是将SQL语句编入配置文件中，避免SQL语句在Java程序中大量出现，方便后续对SQL语句的修改与配置。</span><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">MyBatis中使用parameterType向SQL语句传参，在SQL引用传参可以使用#{Parameter}和${Parameter}两种方式</span></p><p><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">使用#{Parameter}构造SQL的代码如下所示</span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="cs"><code><span class="code-snippet_outer">&lt;<span class="code-snippet__keyword">select</span> id=<span class="code-snippet__string">&#34;getUsername&#34;</span> resultType=<span class="code-snippet__string">&#34;com.example.bean.User&#34;</span>&gt;</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__keyword">select</span> id,name,age <span class="code-snippet__keyword">from</span> user <span class="code-snippet__keyword">where</span> name <span class="code-snippet__meta">#{name}</span></span></code><code><span class="code-snippet_outer">&lt;<span class="code-snippet__keyword">select</span>&gt;</span></code></pre><p><img class="rich_pages wxw-img" data-ratio="0.45285087719298245" data-type="png" data-w="912" style="box-sizing: border-box;outline: none;border: 0px none;margin: 0px;max-width: 100%;overflow-wrap: break-word;color: rgb(180, 180, 180);cursor: zoom-in;caret-color: rgb(180, 180, 180);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif;font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=259a721d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZtqxdrh03ggWwFzGcosCyFMgliaGTJqCFKv4w709kr9Zh54KJBiarUt9w%2F640%3Fwx_fmt%3Dpng"/><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"></span></p><p>    从Debug回显的SQL语句执行过程可以看出，使用#{Parameter}方式会使用“?”占位进行预编译，因此不存在SQL注入的问题。用户可以尝试构造“name”值为“z1ng or 1=1”进行验证。回显如下，由于程序未查询到结果出现了空指针异常，因此此时不存在SQL注入。</p><p><span style="color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;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;">使用${Parameter}构造SQL的代码如下所示：</span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="cs"><code><span class="code-snippet_outer">&lt;<span class="code-snippet__keyword">select</span> id = <span class="code-snippet__string">&#34;getUsername&#34;</span> resultType = <span class="code-snippet__string">&#34;com.example.bean.User&#34;</span>&gt;</span></code><code><span class="code-snippet_outer">    <span class="code-snippet__keyword">select</span> id,name,age <span class="code-snippet__keyword">from</span> user <span class="code-snippet__keyword">where</span> name = ${name}</span></code><code><span class="code-snippet_outer">&lt;<span class="code-snippet__keyword">select</span>&gt;</span></code></pre><p><img class="rich_pages wxw-img" data-ratio="0.9084895259095921" data-type="png" data-w="907" style="box-sizing: border-box;outline: none;border: 0px none;margin: 0px;max-width: 100%;overflow-wrap: break-word;color: rgb(180, 180, 180);cursor: zoom-in;caret-color: rgb(180, 180, 180);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif;font-size: 16px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=f629e529&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZtvERE3M3VvTdRS4AuKu68p6G3vntn9g1b7ub9IickaVMCcWtDtjDOyg%2F640%3Fwx_fmt%3Dpng"/></p><p>name”值被拼接进SQL语句之中，因此此时存在SQL注入。<span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">${Parameter}采用拼接的方式构造SQL，在对用户输入过滤不严格的前提下，此处很可能存在SQL注入。</span></p><p><strong>Hibernate</strong></p><p>    Hibernate是一种ORM框架，全称为 Object_Relative DateBase-Mapping，Hibernate框架是Java持久化API（JPA）规范的一种实现方式。Hibernate 将Java 类映射到数据库表中，从 Java 数据类型映射到 SQL 数据类型。Hibernate是目前主流的Java数据库持久化框架，采用Hibernate查询语言（HQL）注入</p><p><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">    </span><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">HQL的语法与SQL类似，受语法的影响，HQL注入在实际漏洞利用上具有一定的限制。</span><br/></p><p style="margin-bottom: 24px;"><strong><span style="font-size: 20px;">3.jrasp mysql检测模块</span></strong></p><p style="margin-bottom: 24px;"><span style="font-size: 20px;">    </span><span style="font-size: 17px;">  <span style="color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;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;">不同sql client版本，hook类差别大，</span>这里以mysql8.x 为例子说明。</span></p><p style="margin-bottom: 24px;"><span style="font-size: 17px;">1）可配置参数：</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5780392156862745" data-s="300,640" data-type="png" data-w="2550" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=f670adfa&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZqt46sQO5csPibN9ZJ3XEdVaj5YSzt07hEMutoIY50JFMehG53G4B6Zg%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 24px;"><br/></p><p style="margin-bottom: 24px;">2）sql拼接hook</p><pre style="background-color:#ffffff;color:#080808;font-family:&#39;JetBrains Mono&#39;,monospace;font-size:9.8pt;"><span style="color:#067d17;">com.mysql.cj.jdbc.StatementImpl</span></pre><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5153550863723608" data-s="300,640" data-type="png" data-w="2084" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=97db6b7d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZWUXKUWsE2hibw36rddoiaXXXjEeJWfic3SdF2EFwlgtibWxpvWlHNuicl3A%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 24px;">3）sql 预编译hook</p><p style="background-color:#ffffff;color:#080808;font-family:&#39;JetBrains Mono&#39;,monospace;font-size:9.8pt;"><span style="color:#067d17;">com.mysql.cj.jdbc.ClientPreparedStatement,</span><span style="color: rgb(6, 125, 23);font-size: 9.8pt;">com.mysql.cj.jdbc.PreparedStatement</span><span style="color: rgb(6, 125, 23);font-size: 9.8pt;"></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.45726495726495725" data-s="300,640" data-type="png" data-w="2340" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=c606212a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZeKI69dh95s9BpshTQnq9Jk9xCGaJ4KSGdwTMLYwtUQUhKV02q6sYLg%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 24px;"><span style="color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;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;">4</span><span style="color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;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>检测算法<br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.591897233201581" data-s="300,640" data-type="png" data-w="2024" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=b1855fe3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZyTMGgP2KOglDKYLk5B0ftdJ4xvEJ6ApCnqJbshrbNdHbQTvEBehKyQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 24px;"><strong style="caret-color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;text-size-adjust: auto;"><span style="font-size: 20px;">4.sql注入实战</span></strong><br/></p><p style="text-align: left;margin-bottom: 0em;">存在sql拼接的业务代码如下</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.35009671179883944" data-s="300,640" data-type="png" data-w="2068" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=cddaae8e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZJMyiabL1sacvax7ePvR95viaicxh5GhKrKicDQ8f8SFc7ib3ptEQiatVHt9A%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;margin-bottom: 0em;"><br/></p><p style="text-align: left;margin-bottom: 0em;"><strong style="margin: 0px;padding: 0px;color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: left;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;">正常sql（返回用户自己的数据）</strong></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.54375" data-s="300,640" data-type="png" data-w="2240" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=337c68d2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZzZKdLCHQJ3ibVyficl20RxiajVl3HGb7CtKTsdZZ553E8CiatovicANwwzg%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: left;margin-bottom: 0em;"><strong>sql注入（返回了全部用户数据）</strong></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.8368794326241135" data-s="300,640" data-type="png" data-w="2256" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=8313a4af&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZQy66rY0ScickxZH0KachichDcQa2TgcOkXMOic5lpMuWO8uamjFbicPEQw%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 24px;"><br/></p><p style="margin-bottom: 24px;"><strong style="margin: 0px;padding: 0px;color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: justify;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;caret-color: rgb(51, 51, 51);text-size-adjust: auto;"><span style="margin: 0px;padding: 0px;font-size: 20px;">5.检测与防御</span></strong></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.779261586802828" data-s="300,640" data-type="png" data-w="2546" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=48000641&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZQaOSSICnER3Iic5qgJ9V1IvD75jSIoX5wBavz18NSibCuMopGCy17fzg%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 24px;"><br/></p><p style="margin-bottom: 24px;">    值得注意的是不同于复杂的正则规则检测， jrasp内置了 sql 注入词法分析防火墙，单条sql检测时间在0.1ms内完成，误报/漏报率极低。</p><p style="margin-bottom: 24px;">---------------------------------------------------------------------------</p><p style="margin-bottom: 24px;"><span style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-variant-ligatures: normal;orphans: 2;text-align: center;widows: 2;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;float: none;font-size: 15px;color: rgb(0, 0, 0);display: inline !important;">🔥🔥🔥国内技术领先的开源RASP社区 </span><span style="text-decoration: underline;">https://www.jrasp.com</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="1.2792553191489362" data-s="300,640" data-type="png" data-w="752" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=b34fa7df&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYN3W31X1NobuicoeZOzTGWNZiab2qnlR2XZCddMHibpoW2cLywicITV5SliaMKVXJWXlnlquGWP0vdFoFA%2F640%3Fwx_fmt%3Djpeg"/></p><p style="margin-bottom: 24px;"><span style="text-decoration: underline;"></span></p><p style="text-align: center;margin-bottom: 0em;"><br/></p>



<p><a href="https://www.jrasp.com/case/CVE-2020-13942.html">阅读原文</a></p>
]]></content:encoded>
      <pubDate>Sat, 30 Jul 2022 20:03:12 +0800</pubDate>
    </item>
    <item>
      <title>RASP| SPEL/OGNL表达式注入检测与防御</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484412&amp;idx=1&amp;sn=af0462846384a019285c972f07b7155f</link>
      <description>最近表达式注入的漏洞较多，jrasp 目前已经支持spel/ognl 表达式的检测。</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2022-07-15 20:40</span> <span style="display: inline-block;">江苏</span>
</p>

<p>最近表达式注入的漏洞较多，jrasp 目前已经支持spel/ognl 表达式的检测。</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=8d9cde8e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBv7PqfiabjtfCvA2vK9qdhwygAdITCqCmjtZoAXARq4iaHakrCic8Uopdibg%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="font-size: 20px;">    </span><span style="font-size: 14px;">最近表达式注入的漏洞较多，jrasp 目前已经支持spel/ognl 表达式的检测。</span></p><p style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="font-size: 20px;">1.漏洞复现</span></p><p style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;">参考官网：<strong style="font-size: 15.2px;"><span style="font-weight: normal;text-decoration: underline;">https://www.jrasp.com/case/CVE-2020-13942.html</span></strong></p><p style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 1.7;color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 15.2px;font-variant-ligatures: normal;orphans: 2;widows: 2;text-decoration-thickness: initial;"><span style="text-decoration: none;">这里使用OGNL POC：</span><br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-backh="252" data-backw="578" data-galleryid="" data-ratio="0.4363873208858011" data-s="300,640" data-type="png" data-w="2303" style="width: 100%;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=020078a0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBvgzrJje8UyCIV9UEDYVz9BnDlmChuCz8ROn3ax4kYp5l9R2Ue7nOYicA%2F640%3Fwx_fmt%3Dpng"/></p><p><strong><span style="font-size: 20px;">2.攻击详情</span></strong></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.21717171717171718" data-s="300,640" data-type="png" data-w="3168" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=71a6732a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBvaRChnsVGIcDh6z6HfN5upouY5f4eibHfmJxWuwnHuMopEeEolpEzx1Q%2F640%3Fwx_fmt%3Dpng"/></p><p><br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5905006418485238" data-s="300,640" data-type="png" data-w="3116" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=4005aa40&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBv8D0zaIEkHAOcPnPU2fjMn8BNBK3PCZdLFiaf7GibT3LLT4kxT53IOaTw%2F640%3Fwx_fmt%3Dpng"/></p><p><br/></p><p><span style="caret-color: rgb(44, 62, 80);color: rgb(44, 62, 80);font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-size: 20px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;display: inline !important;float: none;"><strong style="margin: 0px;padding: 0px;caret-color: rgb(51, 51, 51);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="margin: 0px;padding: 0px;font-size: 20px;">3.OGNL检测模块</span></strong></span></p><p><span style="font-size: 15px;">这里以ognl 模块为例子说明，管理端配置参数如下：</span><br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="1.0737327188940091" data-s="300,640" data-type="png" data-w="1736" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=bc342546&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBvicDxG43sicrYOvr4k4Sdic6ueyUQuvwmAicnjXZSmCAHj3vjiaj5JosgJWA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.9437428243398392" data-s="300,640" data-type="png" data-w="1742" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=317735ea&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBvwty9LhmaJzXD5CAqEL92AHAwq54pSqSWoGiaeWstm0eTGNiaV9em8eHg%2F640%3Fwx_fmt%3Dpng"/></p><p>hook点选择<br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.6567754698318496" data-s="300,640" data-type="png" data-w="2022" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=f52c7684&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBvMnBYl6b6vhicB7AjOv3S3yiaD3kkdgFHbibR2edf5tgzAmdfpo4u6FjTQ%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="font-size: 15px;"></span></p><p><span style="font-size: 15px;">第一种<span style="caret-color: rgb(51, 51, 51);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;display: inline !important;float: none;">检测</span>算法：黑名单检测算法<br/></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.2879177377892031" data-s="300,640" data-type="png" data-w="2334" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=a7a4bdb9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBv0kUyFm98Yf16HOyxu2JqibDChx35jSkiaJlXpNDBd5tV1lKT6iaZyoqMg%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="font-size: 12px;">    默认黑名单<span style="caret-color: rgb(51, 51, 51);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: justify;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">（黑名单可以管理端配置）</span></span><span style="caret-color: rgb(51, 51, 51);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: justify;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;"></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5724275724275725" data-s="300,640" data-type="png" data-w="2002" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=5de48b7d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBvLOMmBnn4Je0aws8BMUiaP0QDL2BQ2HMvop1CV5I7WZTfahvNUqU8yiaA%2F640%3Fwx_fmt%3Dpng"/></p><p><br/></p><p><span style="caret-color: rgb(51, 51, 51);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;display: inline !important;float: none;">第二种检测</span><span style="caret-color: rgb(51, 51, 51);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;display: inline !important;float: none;">算法：表达式最大长度校验</span><span style="caret-color: rgb(51, 51, 51);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 15px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;display: inline !important;float: none;"></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.26603119584055457" data-s="300,640" data-type="png" data-w="2308" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=83010dee&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBvao5PrkgVrkbjD2pia3HeFxzZFRTkmUfz7LwRt9ezA4w57lqAQFAiakYg%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="font-size: 12px;">    ognl最大允许长度在管理端可以配置</span></p><p><span style="font-size: 20px;"><span style="margin: 0px;padding: 0px;font-style: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;caret-color: rgb(51, 51, 51);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-align: justify;"><span style="margin: 0px;padding: 0px;font-size: 20px;"><strong>4.</strong><strong>SPEL</strong><strong>检测模块</strong></span></span></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.6502890173410405" data-s="300,640" data-type="png" data-w="2076" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=3e6ba359&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgUKGHSkPucGWBZefvfeBvDendJyKbdIUmSGTbe45EibbdTU5q7VWAdGf7icqPDKmHvIMaafe5EYfg%2F640%3Fwx_fmt%3Dpng"/></p><p>    仅介绍hook点，检测算法也是黑名单与长度限制，与ognl 差别不大，不做详细介绍。</p><p>---------------------------------------------------------------------------</p><p><span style="font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;font-family: -apple-system, system-ui, &#34;Segoe UI&#34;, Roboto, Oxygen, Ubuntu, Cantarell, &#34;Fira Sans&#34;, &#34;Droid Sans&#34;, &#34;Helvetica Neue&#34;, sans-serif;font-variant-ligatures: normal;orphans: 2;text-align: center;widows: 2;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;float: none;font-size: 15px;color: rgb(0, 0, 0);display: inline !important;">🔥🔥🔥国内技术领先的开源RASP社区 </span><span style="text-decoration: underline;">https://www.jrasp.com</span></p><p style="text-align: center;margin-bottom: 0em;"><br/></p>



<p><a href="https://www.jrasp.com/case/CVE-2020-13942.html">阅读原文</a></p>
]]></content:encoded>
      <pubDate>Fri, 15 Jul 2022 20:40:06 +0800</pubDate>
    </item>
    <item>
      <title>Java应用的RASP远程调试教程</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484393&amp;idx=1&amp;sn=c8fc2f611d59274f59d57d03b513b473</link>
      <description>介绍Java RASP是基于Java Agent技术实现的，而Java Agent代码无法独立启动，必须依赖</description>
      <content:encoded><![CDATA[<p>
原创 <span>Hsin Tsao</span> <span>2022-07-09 20:35</span> <span style="display: inline-block;">江苏</span>
</p>

<p>介绍Java RASP是基于Java Agent技术实现的，而Java Agent代码无法独立启动，必须依赖</p>
<p></p>



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


<h1 md-src-pos="0..19" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;font-size: 2.2em;padding-top: 0.6em;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">介绍</h1><p md-src-pos="27..200" style="box-sizing: border-box;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;"><span md-src-pos="27..96" style="box-sizing: border-box;">Java RASP是基于Java Agent技术实现的，而Java Agent代码无法独立启动，必须依赖于一个Java运行时程序才能运行。</span> <span md-src-pos="97..125" style="box-sizing: border-box;">如何调试一个Java Agent可以参考之前的一篇推文：</span><a href="https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247483986&amp;idx=1&amp;sn=e8820602ee83324bff4a6c0068a4296a&amp;scene=21#wechat_redirect" md-src-pos="125..200" style="box-sizing: border-box;text-decoration: none;color: rgb(36, 112, 179);" data-linktype="2" localeditorid="4nbt8ri8u9bs1dbkmww">如何 debug JRASP Agent代码</a></p><p md-src-pos="202..349" style="box-sizing: border-box;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;"><span md-src-pos="202..349" style="box-sizing: border-box;">在RASP开发的中后期，则需要在真实的Web服务器上测试。通常这些Java应用程序都运行在远端设备上，开发者本地不具备这样的环境。所以我们需要远程调试一个真实的Java应用，来解决bug或者验证RASP的防护效果。下面将以tomcat为例，介绍如何调试一个应用于远端Java应用的RASP程序。</span></p><p style="text-align: center;margin-bottom: 0em;"><br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img js_insertlocalimg" data-ratio="0.21524663677130046" data-s="300,640" data-type="png" data-w="1115" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=1817c2c9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qtia6O3vfzpmiaYYyDLtkeLwzOrkApZyXkZDzgEIz2N98zdrf3UZaT4iaQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img js_insertlocalimg" data-ratio="0.41328125" data-s="300,640" data-type="png" data-w="1280" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=aabc33ca&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qPSUtQCuZuic2vuebxMdL3ujq461jia1tO5HObIlHPQIwyCFK2YNdMWaQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;margin-bottom: 0em;"><br/></p><p style="text-align: left;margin-bottom: 0em;"><span style="background-color: rgb(255, 255, 255);color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-size: 1.8em;font-weight: bold;text-align: start;">环境条件</span><br/></p><ol md-src-pos="359..429" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p>运行于Windows上的IDEA CE 2021.2(社区版)</p></li><li style="box-sizing: border-box;"><p>运行于Linux上的apache-tomcat-9.0.0.m1</p></li></ol><h2 md-src-pos="431..438" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.2;font-size: 1.8em;padding-top: 0.6em;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">调试步骤</h2><h4 md-src-pos="440..458" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;font-size: 14px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">1. 设置IDEA远程调试</h4><ol md-src-pos="459..760" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p>点击编辑运行配置</p></li><li style="box-sizing: border-box;"><p>新建一个远程JVM调试模板</p></li><li style="box-sizing: border-box;"><p>调试器模式设置为附加到远程JVM，传输方式选择Socket。IDEA还有ShareMemory方式的传输方式，这两者的本质都是用于传输远程调试信息。双机调试建议使用Socket模式。</p></li><li style="box-sizing: border-box;"><p>设置目标Java应用所在机器的IP地址，以及一个未被使用的端口。</p></li><li style="box-sizing: border-box;"><p>选择目标Java应用运行时JDK版本，将会自动生成一些启动参数。<strong md-src-pos="654..673" style="font-weight: bold;box-sizing: border-box;">不同的JDK版本的启动参数不同</strong>，所以需要注意这点。</p></li><li style="box-sizing: border-box;"><p>复制自动生成的JVM启动参数，用于后续添加到目标Java应用的启动参数中。</p></li><li style="box-sizing: border-box;"><p>设置需要调试的代码 </p><p><img class="rich_pages wxw-img js_insertlocalimg" data-ratio="0.69140625" data-s="300,640" data-type="png" data-w="1280" style="margin: 0px;padding: 0px;max-width: 100%;vertical-align: bottom;color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, system-ui, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: center;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=daf63377&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qN1uicJphgsuee2qaY0KGwFcczG4j9HQQGEC2t9ic6VgLQEBoE73rS4AA%2F640%3Fwx_fmt%3Dpng"/><br/></p></li></ol><h4 md-src-pos="762..773" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;font-size: 14px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">2. 下断点</h4><ol md-src-pos="774..918" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p>在刚刚设置的需要调试的代码中下断点。</p></li><li style="box-sizing: border-box;"><p>断点的位置尽量高，而且最好是在逻辑简单且必经之地。因为RASP代码逻辑是由目标Java应用触发，而不是我们手动触发的。另外建议多下几个断点，以保障IDEA可以正确捕获断点。 </p><p><br/></p></li><li><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.21524663677130046" data-s="300,640" data-type="png" data-w="1115" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=1817c2c9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qtia6O3vfzpmiaYYyDLtkeLwzOrkApZyXkZDzgEIz2N98zdrf3UZaT4iaQ%2F640%3Fwx_fmt%3Dpng"/></p></li></ol><h4 md-src-pos="920..943" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;font-size: 14px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">3. 在目标应用中添加调试的启动参数</h4><ol md-src-pos="944..1628" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p><span style="background-color: rgb(255, 255, 255);">将IDEA自动生成的远程JVM启动参数</span>添<span style="background-color: rgb(255, 255, 255);">加到目标应用的启动参数中.</span></p></li><li style="background-color: rgb(255, 255, 255);box-sizing: border-box;"><p>以tomcat为例：</p></li><ul md-src-pos="1273..1611" style="background-color: rgb(255, 255, 255);box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p md-src-pos="1276..1282" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">Linux:</p><pre md-src-pos="1293..1416" style="box-sizing: border-box;margin-top: 16px;margin-bottom: 16px;font: 0.85em / 1.45 &#34;JetBrains Mono&#34;, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;padding: 16px;overflow: auto;border-radius: 3px;color: rgb(8, 8, 8);background-color: rgba(212, 222, 231, 0.247);"><code md-src-pos="1293..1416" style="white-space: pre-wrap;box-sizing: border-box;font-style: normal;font-variant: normal;font-weight: normal;font-stretch: normal;font-size: 11.9px;line-height: inherit;font-family: &#34;JetBrains Mono&#34;, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;padding: 0px;margin: 0px;border-radius: 3px;color: rgb(8, 8, 8);background: transparent;word-break: normal;border-width: 0px;border-style: initial;border-color: initial;display: inline;max-width: initial;overflow: initial;overflow-wrap: normal;"><span md-src-pos="1293..1303" style="box-sizing: border-box;"></span><span md-src-pos="1303..1389" style="box-sizing: border-box;">export JAVA_OPTS=<span style="box-sizing: border-box;color: rgb(6, 125, 23);">&#39;-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005&#39;</span></span><span md-src-pos="1389..1390" style="box-sizing: border-box;"></span><span md-src-pos="1401..1416" style="box-sizing: border-box;"></span></code></pre></li><li style="box-sizing: border-box;"><p md-src-pos="1428..1435" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">windows</p><pre md-src-pos="1446..1564" style="box-sizing: border-box;margin-top: 16px;margin-bottom: 16px;font: 0.85em / 1.45 &#34;JetBrains Mono&#34;, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;padding: 16px;overflow: auto;border-radius: 3px;color: rgb(8, 8, 8);background-color: rgba(212, 222, 231, 0.247);"><code md-src-pos="1446..1564" style="white-space: pre-wrap;box-sizing: border-box;font-style: normal;font-variant: normal;font-weight: normal;font-stretch: normal;font-size: 11.9px;line-height: inherit;font-family: &#34;JetBrains Mono&#34;, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;padding: 0px;margin: 0px;border-radius: 3px;color: rgb(8, 8, 8);background: transparent;word-break: normal;border-width: 0px;border-style: initial;border-color: initial;display: inline;max-width: initial;overflow: initial;overflow-wrap: normal;"><span md-src-pos="1446..1456" style="box-sizing: border-box;"></span><span md-src-pos="1456..1537" style="box-sizing: border-box;">set JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=<span style="box-sizing: border-box;color: rgb(23, 80, 235);">5005</span></span><span md-src-pos="1537..1538" style="box-sizing: border-box;"></span><span md-src-pos="1549..1564" style="box-sizing: border-box;"></span></code></pre></li><li style="box-sizing: border-box;"><p md-src-pos="1576..1611" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">e.g</p></li></ul><ul md-src-pos="1273..1611" style="background-color: rgb(255, 255, 255);box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);" class="list-paddingleft-1"><li><p style="margin-bottom: 0em;"><img class="rich_pages wxw-img" data-ratio="0.568" data-s="300,640" data-type="png" data-w="875" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=40070455&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qYvDCHayA1R1VuGk3MSB8uibjvmIm1WCdhlSbFTmRQON7rHFxtfQnsdg%2F640%3Fwx_fmt%3Dpng"/></p></li></ul><ul md-src-pos="1042..1198" style="background-color: rgb(255, 255, 255);box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p>Linux：<code md-src-pos="1051..1082" style="box-sizing: border-box;font: 0.9em &#34;JetBrains Mono&#34;, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;padding: 0.2em 0.4em;margin: 2px;border-radius: 3px;color: rgb(8, 8, 8);background-color: rgba(212, 222, 231, 0.247);">${tomcat安装目录}/bin/catalina.sh</code></p></li><li style="box-sizing: border-box;"><p>Windows：<code md-src-pos="1101..1133" style="box-sizing: border-box;font: 0.9em &#34;JetBrains Mono&#34;, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;padding: 0.2em 0.4em;margin: 2px;border-radius: 3px;color: rgb(8, 8, 8);background-color: rgba(212, 222, 231, 0.247);">${tomcat安装目录}/bin/catalina.bat</code></p></li><li style="box-sizing: border-box;"><p>e.g: <code md-src-pos="1149..1198" style="box-sizing: border-box;font: 0.9em &#34;JetBrains Mono&#34;, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;padding: 0.2em 0.4em;margin: 2px;border-radius: 3px;color: rgb(8, 8, 8);background-color: rgba(212, 222, 231, 0.247);">/usr/web/apache-tomcat-9.0.0.M1/bin/catalina.sh</code></p></li></ul><ol md-src-pos="998..1628" style="background-color: rgb(255, 255, 255);box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);list-style-type: lower-roman;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p md-src-pos="1002..1034" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">tomcat启动脚本目录：<code md-src-pos="1015..1034" style="box-sizing: border-box;font: 0.9em &#34;JetBrains Mono&#34;, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;padding: 0.2em 0.4em;margin: 2px;border-radius: 3px;color: rgb(8, 8, 8);background-color: rgba(212, 222, 231, 0.247);">${tomcat安装目录}/bin</code></p></li><li style="box-sizing: border-box;"><p md-src-pos="1207..1265" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">修改tomcat启动脚本，添加启动参数。将刚刚复制的JVM启动参数以如下的方式添加至catalina.sh的最前面:</p></li><li style="box-sizing: border-box;"><p md-src-pos="1620..1628" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">保存修改后的脚本</p></li></ol></ol><h4 md-src-pos="1630..1648" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;font-size: 14px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">4. 启动目标Java应用</h4><ol md-src-pos="1649..1703" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p>重启修改脚本后的Java应用</p></li><li style="box-sizing: border-box;"><p>以tomcat为例：</p><p><br/></p></li><li><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.1768018018018018" data-s="300,640" data-type="png" data-w="888" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=2ec538cd&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qe7WPiaYISa6uXiasjxIbc1tclcdUsiaCvBgDQxia1PylEbiaKn8KCDLSDyw%2F640%3Fwx_fmt%3Dpng"/></p></li><li style="box-sizing: border-box;"><p md-src-pos="1803..1826" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);"><br/></p></li></ol><h4 md-src-pos="1705..1723" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;font-size: 14px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">5. 启动IDEA远程调试</h4><ol md-src-pos="1724..2003" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p md-src-pos="1727..1771" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">选择刚刚新建的远程JVM调试配置并启动 </p><p md-src-pos="1727..1771" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);"><br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.41328125" data-s="300,640" data-type="png" data-w="1280" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=aabc33ca&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qPSUtQCuZuic2vuebxMdL3ujq461jia1tO5HObIlHPQIwyCFK2YNdMWaQ%2F640%3Fwx_fmt%3Dpng"/></p></li><li style="box-sizing: border-box;"><p md-src-pos="1776..1799" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">如果显示连接成功，则表示双机调试通道已经建立。</p></li><li style="box-sizing: border-box;"><p md-src-pos="1803..1826" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">如果显示连接失败或者连接超时，则需要排查原因：</p></li><ol class="list-paddingleft-1" style="list-style-type: lower-alpha;"><p md-src-pos="1803..1826" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">1检查双机是否可以ping通。</p></ol><p>    2.检查远端机器上的目标Java应用是否正确地监听在调试端口号上。可以使用如下命令：</p><pre style="background-color:#ffffff;color:#080808;font-family:&#39;JetBrains Mono&#39;,monospace;font-size:9.8pt;"><span style="color:#0033b3;">- </span><span style="color:#8c8c8c;font-style:italic;">`lsof -i:端口号`<br/></span><span style="color:#0033b3;">- </span>e.g</pre><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.10141987829614604" data-s="300,640" data-type="png" data-w="986" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=e61ade9d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qicZxq36UHryIwmfiaNNBCGXPMmZWLc2OnlSpayPkpicNic16ZibX3G4M34w%2F640%3Fwx_fmt%3Dpng"/></p><p><strong md-src-pos="1966..2002" style="font-weight: bold;box-sizing: border-box;">    3.通常远端服务器都设置了防火墙或者安全组，此时需要放开该调试端口号</strong>。</p></ol><h4 md-src-pos="2006..2027" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;font-size: 14px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">6. 对目标应用启动RASP注入</h4><ol md-src-pos="2028..2230" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p md-src-pos="2031..2047" style="box-sizing: border-box;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);">查看所有Java应用程序pid:</p></li></ol><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.14910025706940874" data-s="300,640" data-type="png" data-w="389" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=18024389&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qN9nemWQK1MhIy5YY2u6VA773MM0xbMgeBXhPIJDP0xckEXzIex1B5Q%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: left;margin-bottom: 0em;"><span style="background-color: rgb(255, 255, 255);color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-size: 14px;text-align: left;">    2.进入到jrasp安装目录</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="bash"><code><span class="code-snippet_outer"><span class="code-snippet__built_in">cd</span> /usr/<span class="code-snippet__built_in">local</span>/jrasp/bin</span></code></pre></section><p style="background-color:#ffffff;color:#080808;font-family:&#39;JetBrains Mono&#39;,monospace;font-size:9.8pt;"><span style="color:#0033b3;">  3.</span>手动注入jrasp<span style="font-size: 9.8pt;"></span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js"><code><span class="code-snippet_outer">./jrasp.sh -p pid</span></code></pre></section><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.11226851851851852" data-s="300,640" data-type="png" data-w="864" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=d8ecf892&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5q6wHosek3dr4vjn13TFZvAOmdwWdfmoQezJEI6dgVKK9kQy2z51M7zg%2F640%3Fwx_fmt%3Dpng"/></p><h4 md-src-pos="2236..2248" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;font-size: 14px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">7. 触发断点</h4><ol md-src-pos="2249..2610" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p>断点触发与否主要是基于所要测试的代码和断点位置。一般来说，如果断点设置在AgentMain入口处，则jrasp注入的时候，IDEA即可捕获断点。</p></li><li style="box-sizing: border-box;"><p>如果需要调试的代码和AgentMain函数不在一个模块中，则需要针对性的触发。双机调试建立之后，可能IDEA并未捕获断点，这是因为目前调试的RASP模块还未被执行。</p></li><li style="box-sizing: border-box;"><p>此时需要针对性的触发断点。举两个例子：</p></li><ol md-src-pos="2437..2610" style="box-sizing: border-box;padding: 0px 0px 0px 2em;margin-top: 0px;margin-bottom: 0px;color: rgb(8, 8, 8);list-style-type: lower-roman;" class="list-paddingleft-1"><li style="box-sizing: border-box;"><p>如果测试的是RASP监控tomcat request请求模块的代码，那么直接浏览器访问tomcat服务器即可触发断点。</p></li><li style="box-sizing: border-box;"><p>如果测试的是RASP对于RCE检测与阻断能力模块的代码，那么需要使用rce相关的exp攻击tomcat服务器；或者在tomcat服务器内部内置jsp脚本模拟RCE，然后通过浏览器网络请求调用该jsp脚本。</p></li></ol></ol><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.50546875" data-s="300,640" data-type="png" data-w="1280" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=36a72597&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPOFDaM0v2FuX4EQd5sSb5qXA6Sk1U9pTYdMvNCXlKyHYDAjRRTzzxTrI2z0k1uZnYNbdrwiazgcmQ%2F640%3Fwx_fmt%3Dpng"/></p><h2 md-src-pos="2637..2642" style="box-sizing: border-box;margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.2;font-size: 1.8em;padding-top: 0.6em;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">总结</h2><p md-src-pos="2644..2988" style="box-sizing: border-box;margin-top: 16px;margin-bottom: 16px;color: rgb(8, 8, 8);font-family: Helvetica, Arial, freesans, sans-serif;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;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;"><span md-src-pos="2644..2988" style="box-sizing: border-box;">    RASP是依赖目标Java进程的，所以RASP的远程调试也是基于Java应用的远程调试。比如说调试Tomcat上的RASP，要先在Tomcat的JVM启动参数中添加远程调试的设置，RASP注入后，RASP的代码将作为Tomcat的一部分被JVM运行，可远程调试Tomcat即可远程调试RASP。补充一点，调试时无需Tomcat源码，在RASP的代码中设置断点，IDEA将自动捕获。但是，RASP大多时候需要hook Tomcat的API，如果无法精准地知道API及其函数描述，可以利用maven中添加对应的tomcat版本的依赖包，上述的远程调试技巧也可以定位到相关的tomcat源码中，这样子在调试堆栈中，既可以看RASP的代码，也可以看JDK源码和tomcat源码，调试过程更加清晰。</span></p><p><br/></p>



<p><a href="2247484393">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=99dea2c8&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzg5MjQ1OTkwMg%3D%3D%26mid%3D2247484393%26idx%3D1%26sn%3Dc8fc2f611d59274f59d57d03b513b473%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sat, 09 Jul 2022 20:35:00 +0800</pubDate>
    </item>
    <item>
      <title>RASP| Spring data mongodb spel(CVE-2022-22980)</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484378&amp;idx=1&amp;sn=3e056f671ee72c1f98a63c4b8677a1ec</link>
      <description>Spring Data MongoDB 是一个开源项目，它提供了与 MongoDB 文档数据库的集成。近日监控到 Spring Data MongoDB 爆出 SpEL 表达式注入漏洞 CVE-2022-22980</description>
      <content:encoded><![CDATA[<p>
<span>Hsin Tsao</span> <span>2022-06-25 17:40</span> <span style="display: inline-block;">江苏</span>
</p>

<p>Spring Data MongoDB 是一个开源项目，它提供了与 MongoDB 文档数据库的集成。近日监控到 Spring Data MongoDB 爆出 SpEL 表达式注入漏洞 CVE-2022-22980</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=64bf3a42&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYNuarDSud2t5MceUBqVxqwwJnvZMw7uib5IdzzY8P9IYFBvCve0griayj0FY3XF7bXSea5f2raaVh8Q%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;visibility: visible;line-height: 27.200000762939453px;">    Spring Data MongoDB 是一个开源项目，它提供了与 MongoDB 文档数据库的集成，可以极大提高 Java 开发人员在使用 MongoDB 时的效率。近日监控到 Spring Data MongoDB 爆出 SpEL 表达式注入漏洞 CVE-2022-22980。</p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;">    当使用 `@Query` 或 `@Aggregation` 注释进行查询并且通过 SpEL 表达式中形如 `?0` 、`?1` 等占位符进行参数赋值时，可导致 SpEL 表达式注入漏洞，从而实现 RCE 。影响版本如下：</p><ul class="list-paddingleft-1" mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px 0px 0px 1.5em;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;list-style-type: disc;line-height: 27.200000762939453px;"><li style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;font-size: 17px;line-height: 27.200000762939453px;"><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;text-indent: 0px;font-size: 17px;line-height: 27.200000762939453px;"> v3.4.0</p></li><li style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;font-size: 17px;line-height: 27.200000762939453px;"><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;text-indent: 0px;font-size: 17px;line-height: 27.200000762939453px;"> v3.3.0 to v3.3.4</p></li><li style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;font-size: 17px;line-height: 27.200000762939453px;"><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;text-indent: 0px;font-size: 17px;line-height: 27.200000762939453px;"> Older, unsupported versions are also affected</p></li></ul><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;"><br mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;font-size: 17px;line-height: 27.200000762939453px;"/></p><p><strong mp-original-font-size="14" mp-original-line-height="22.399999618530273" style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;outline: 0px;max-width: 100%;line-height: 22.4px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;">环境搭建</span></strong></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;">    </span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;text-align: justify;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;">    为了方便漏洞调试分析，新建一个 SpringBoot 项目，并引入 Spring Data MongoDB v3.4.0 。</span><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;">参考  Spring Data MongoDB 查询 SpEL 解析定义规范以及补丁对比分析结果，完成调试环境配置。</span><span style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;text-align: justify;">最后为了方便构造漏洞测试过程，编写如下控制器：</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.39579158316633267" data-s="300,640" data-type="png" data-w="1996" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=1752546b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNuarDSud2t5MceUBqVxqww9xwbM0IicmvsMIkR8ykqUUw9iaic3QBdSxicuelZZibt3Uibc4uQWYRxbjwA%2F640%3Fwx_fmt%3Dpng"/></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;"><br mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;font-size: 17px;line-height: 27.200000762939453px;"/></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;"><span style="color: rgb(34, 34, 34);font-family: system-ui, -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(34, 34, 34);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">(</span><span style="margin: 0px;padding: 0px;color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(34, 34, 34);text-decoration: none;font-size: 15px;text-size-adjust: auto;background-color: rgb(240, 249, 255);float: none;display: inline !important;">https://github.com/threedr3am/learnjavabug/tree/master/spring/spring-data-mongodb-spel-CVE-2022-22980</span><span style="color: rgb(34, 34, 34);font-family: system-ui, -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(34, 34, 34);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">)</span></p><p><strong mp-original-font-size="14" mp-original-line-height="22.399999618530273" style="font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;outline: 0px;max-width: 100%;line-height: 22.4px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;">漏洞复现</span></strong></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;"><br/></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.5440000295639038px;orphans: auto;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;line-height: 27.200000762939453px;">请求参数为 SpEL 表达式注入漏洞载荷，最终效果如下：</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="python"><code><span class="code-snippet_outer">curl --location --request POST <span class="code-snippet__string">&#39;http://49.235.111.228:9999/demo&#39;</span> \</span></code><code><span class="code-snippet_outer">--header <span class="code-snippet__string">&#39;Content-Type: application/x-www-form-urlencoded&#39;</span> \</span></code><code><span class="code-snippet_outer">--data-urlencode <span class="code-snippet__string">&#39;keyword=T(java.lang.String).forName(&#39;</span>\<span class="code-snippet__string">&#39;&#39;</span>java.lang.Runtime<span class="code-snippet__string">&#39;\&#39;&#39;</span>).getRuntime().exec(<span class="code-snippet__string">&#39;\&#39;&#39;</span>/System/Applications/Calculator.app/Contents/MacOS/Calculato<span class="code-snippet__string">r&#39;\&#39;&#39;</span>)<span class="code-snippet__string">&#39;</span></span></code></pre><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.44780545670225386" data-s="300,640" data-type="png" data-w="3372" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=e680c8ef&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNuarDSud2t5MceUBqVxqwwaT83jnOicrmmqhBrNAv8hHdMBqFrduWR8FqVs1BDKbODYgBUib533YRw%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;"><br/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;">管理端：</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.03904109589041096" data-s="300,640" data-type="png" data-w="2920" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=d28230f8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNuarDSud2t5MceUBqVxqwwz8qGxVXuuibZkZkictHvcgNW2hKa4iaC0ibFrdPyoMXW6vhnfQ7jZQdia3w%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;font-size: 14px;"></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.632183908045977" data-s="300,640" data-type="png" data-w="3132" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=fc3c61a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNuarDSud2t5MceUBqVxqwweMMhmINlSeNYMdykNGjItxpVtEQKD1qJt9JjtovjexugrD1eiag6GTQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;font-size: 14px;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"><br style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></strong></span></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;text-align: center;">匹配到命令执行的调用栈，判定为高危<br/></p><p><strong mp-original-font-size="14" mp-original-line-height="22.399999618530273" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;font-size: 14px;line-height: 22.4px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;">后续功能迭代<br mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;"/></span></strong><span mp-original-font-size="18" mp-original-line-height="28.799999237060547" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;font-size: 18px;line-height: 28.8px;box-sizing: border-box !important;overflow-wrap: break-word !important;"></span></p><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;clear: both;min-height: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;outline: 0px;max-width: 100%;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-size-adjust: auto;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><br/></p><ul class="list-paddingleft-1" style="list-style-type: disc;"><li><p mp-original-font-size="17" mp-original-line-height="27.200000762939453" style="margin: 0px;padding: 0px;clear: both;min-height: 1em;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;outline: 0px;max-width: 100%;caret-color: rgb(34, 34, 34);color: rgb(34, 34, 34);font-family: system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-size-adjust: auto;line-height: 27.2px;box-sizing: border-box !important;overflow-wrap: break-word !important;">增加SPEL插件模块：近期<span style="color: rgb(34, 34, 34);font-family: system-ui, -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(34, 34, 34);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">SPEL</span>表达式注入漏洞发生多个，增加表达式检测插件，提高检测能力；</p></li></ul><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;text-align: center;"><br/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 14px;"> </span><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 14px;"></span></p><p><svg viewBox="0 0 1 1" style="float:left;line-height:0;width:0;vertical-align:top;"></svg></p><p><img class="rich_pages wxw-img __bg_gif" data-ratio="0.1503268" data-type="gif" data-w="306" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;vertical-align: middle;width: 45px;overflow-wrap: break-word !important;visibility: visible !important;height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=fadc4f18&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_gif%2FKMrlKvwl2bmf57W4jZSbyQtcwibY2vdHiad7usGjFAC22x2uWceQsicljpCw6MJDbtIbuh25KyqFzLDn8dNt2bOsw%2F640%3Fwx_fmt%3Dgif"/></p><p><svg viewBox="0 0 1 1" style="float:left;line-height:0;width:0;vertical-align:top;"></svg></p><p><br/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 12px;">如需获取更多信息，请访问我们的页面(http://www.jrasp.com/)  开源免费，欢迎使用</span></p><ul class="list-paddingleft-1" style="margin: 0px;padding: 0px 0px 0px 2.2em;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><li style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 12px;"><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 12px;">微信：sear2022</span></p></li><li style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 12px;"><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 12px;">jrasp 目前已经接入主机超过500，防护进程超过5000+，成熟稳定；</span><span style="font-family: -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"></span><span style="font-family: -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#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;letter-spacing: 0.544px;"></span></p></li></ul><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="1.2792553191489362" data-s="300,640" data-type="jpeg" data-w="752" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=f4b28f43&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYMiaKhsaibCf9YDD5da8icZm8iaWrVdQj7SibGLrSEiasZq7jQM40ayehC23RHU3YWGarTMwqKxxPbT8JJA%2F640%3Fwx_fmt%3Djpeg"/></p>




]]></content:encoded>
      <pubDate>Sat, 25 Jun 2022 17:40:07 +0800</pubDate>
    </item>
    <item>
      <title>jrasp如何定制web插件</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484331&amp;idx=1&amp;sn=7d4db7f781721c7a1f764804f6f79669</link>
      <description>JRASP 部署容易、接入便捷和安全插件面向开源社区等特点，得到越来越多的企业用户青睐，本文以 Un</description>
      <content:encoded><![CDATA[<p>
<span>Hsin Tsao</span> <span>2022-06-12 19:16</span> <span style="display: inline-block;">江苏</span>
</p>

<p>JRASP 部署容易、接入便捷和安全插件面向开源社区等特点，得到越来越多的企业用户青睐，本文以 Un</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=2ba37f49&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBX98XnSZ1pAkkn4EehLnwWo2V0hmK6FnTSg1UiaQK2yUo4tnHUiblSiczhg%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;text-align: left;"><span style="font-size: 16px;"><span style="font-size: 16px;color: rgb(0, 0, 0);">    JRASP 部署容易、接入便捷和安全插件面向开源<span style="color: rgb(0, 0, 0);font-family: -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#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;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: left;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">社</span><span style="margin: 0px;padding: 0px;color: rgb(0, 0, 0);font-family: -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#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;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: left;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;float: none;display: inline !important;">区等特点</span>，得到越来越多的企业用户青睐，本文以<span style="color: rgb(51, 51, 51);font-family: -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#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;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;"> </span><span style="color: rgb(51, 51, 51);font-family: -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#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;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">Undertow</span>安全插件的视角来介绍下如何定制属于自己的插件。</span><br/></span></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;text-align: center;"><br/></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;white-space: normal;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;">undertow简介</strong></p><p><svg viewBox="0 0 1 1" style="float:left;line-height:0;width:0;vertical-align:top;"></svg></p><p><span style="font-family: -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;">    Undertow 是红帽公司开发的一款基于 NIO 的高性能 Web 嵌入式服务器。</span><br/></p><p><span style="font-family: -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;">特点 :</span><br/></p><ul class="list-paddingleft-1" style="list-style-type: disc;"><li><p>轻量级：它是一个 Web 服务器，但不像传统的 Web 服务器有容器概念，它由两个核心 Jar 包组成，加载一个 Web 应用可以小于 10MB 内存</p></li><li><p>Servlet3.1 支持：它提供了对 Servlet3.1 的支持</p></li><li><p>WebSocket 支持：对 Web Socket 完全支持，用以满足 Web 应用巨大数量的客户端</p></li><li><p>嵌套性：它不需要容器，只需通过 API 即可快速搭建 Web 服务器。</p><p><br/></p><p>springboot 默认内嵌的web容器是tomcat，可以替换为undertow</p></li></ul><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="xml"><code><span class="code-snippet_outer">        <span class="code-snippet__tag">&lt;<span class="code-snippet__name">dependency</span>&gt;</span></span></code><code><span class="code-snippet_outer">            <span class="code-snippet__tag">&lt;<span class="code-snippet__name">groupId</span>&gt;</span>org.springframework.boot<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">groupId</span>&gt;</span></span></code><code><span class="code-snippet_outer">            <span class="code-snippet__tag">&lt;<span class="code-snippet__name">artifactId</span>&gt;</span>spring-boot-starter-web<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">artifactId</span>&gt;</span></span></code><code><span class="code-snippet_outer">            <span class="code-snippet__tag">&lt;<span class="code-snippet__name">exclusions</span>&gt;</span></span></code><code><span class="code-snippet_outer">                <span class="code-snippet__tag">&lt;<span class="code-snippet__name">exclusion</span>&gt;</span></span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__tag">&lt;<span class="code-snippet__name">groupId</span>&gt;</span>org.springframework.boot<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">groupId</span>&gt;</span></span></code><code><span class="code-snippet_outer">                    <span class="code-snippet__tag">&lt;<span class="code-snippet__name">artifactId</span>&gt;</span>spring-boot-starter-tomcat<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">artifactId</span>&gt;</span></span></code><code><span class="code-snippet_outer">                <span class="code-snippet__tag">&lt;/<span class="code-snippet__name">exclusion</span>&gt;</span></span></code><code><span class="code-snippet_outer">            <span class="code-snippet__tag">&lt;/<span class="code-snippet__name">exclusions</span>&gt;</span></span></code><code><span class="code-snippet_outer">        <span class="code-snippet__tag">&lt;/<span class="code-snippet__name">dependency</span>&gt;</span></span></code><code><span class="code-snippet_outer">        <span class="code-snippet__tag">&lt;<span class="code-snippet__name">dependency</span>&gt;</span></span></code><code><span class="code-snippet_outer">            <span class="code-snippet__tag">&lt;<span class="code-snippet__name">groupId</span>&gt;</span>org.springframework.boot<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">groupId</span>&gt;</span></span></code><code><span class="code-snippet_outer">            <span class="code-snippet__tag">&lt;<span class="code-snippet__name">artifactId</span>&gt;</span>spring-boot-starter-undertow<span class="code-snippet__tag">&lt;/<span class="code-snippet__name">artifactId</span>&gt;</span></span></code><code><span class="code-snippet_outer">        <span class="code-snippet__tag">&lt;/<span class="code-snippet__name">dependency</span>&gt;</span></span></code></pre><p><br/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;"><br style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;">http request 类</strong></p><p><svg viewBox="0 0 1 1" style="float:left;line-height:0;width:0;vertical-align:top;"></svg></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><br style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;">    rasp检测到敏感行为时，可以获取关联到该请求的报文详情（http、socket、rpc等），hook 这些类是实现关联的基础。对于 undertow选择下面的4个类hook。<br/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"> </p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;font-size: 14px;overflow-wrap: break-word !important;">01</span></strong></p><p><img class="rich_pages wxw-img" data-ratio="1" style="margin: 0px;padding: 0px;max-width: 100%;height: auto !important;vertical-align: middle;outline: 0px;box-sizing: border-box;overflow-wrap: break-word !important;width: 300px !important;visibility: visible !important;" data-type="svg" data-w="150" src="https://wechat2rss.xlab.app/img-proxy/?k=0cb1b678&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_svg%2FJCrjicctRMofgHPLnZN70OoBscLaJHbYicSic9NYy6gWYQIvtHJ485zkS6drDhFKaJxEjfM6WZK9lrSuAQibSG7Lqqicgjia72XaWu%2F640%3Fwx_fmt%3Dsvg"/></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;">http info</strong></p><pre style="background-color:#ffffff;color:#080808;font-family:&#39;JetBrains Mono&#39;,monospace;font-size:9.8pt;"><strong><span style="color: rgb(0, 0, 0);">&lt;1&gt; io.undertow.servlet.handlers.ServletInitialHandler#</span></strong></pre><pre style="background-color:#ffffff;color:#080808;font-family:&#39;JetBrains Mono&#39;,monospace;font-size:9.8pt;"><strong><span style="color: rgb(0, 0, 0);">handleFirstRequest</span></strong></pre><pre style="background-color:#ffffff;color:#080808;font-family:&#39;JetBrains Mono&#39;,monospace;font-size:9.8pt;"><span style="color:#067d17;"><br/></span></pre><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5822342901474011" data-s="300,640" style="" data-type="png" data-w="2578" src="https://wechat2rss.xlab.app/img-proxy/?k=dd91578f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBXDRQ5OskO4nAe26jLS1JLxia9O6hlz0c6AtzDI57hkMiaiaHmhTFZjwMUg%2F640%3Fwx_fmt%3Dpng"/></p><pre style="background-color:#ffffff;color:#080808;font-family:&#39;JetBrains Mono&#39;,monospace;font-size:9.8pt;"><span style="color:#000000;">HttpServerExchange </span>exchange 对象可以获取http请求的相关信息如cookie、header等</pre><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.38788112697800076" data-s="300,640" style="" data-type="png" data-w="2591" src="https://wechat2rss.xlab.app/img-proxy/?k=3c03ad7c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBXNS9SDD2awibFwX9rIdLFgskJqO7cUoicxD52FyibuUFmYJSMCja79B99w%2F640%3Fwx_fmt%3Dpng"/></p><pre style="margin: 0px;padding: 0px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;background-color: rgb(255, 255, 255);color: rgb(8, 8, 8);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 9.8pt;"><br/></pre><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;font-size: 14px;overflow-wrap: break-word !important;">02</span></strong></p><p><img class="rich_pages wxw-img" data-ratio="1" style="margin: 0px;padding: 0px;max-width: 100%;height: auto !important;vertical-align: middle;outline: 0px;box-sizing: border-box;overflow-wrap: break-word !important;width: 300px !important;visibility: visible !important;" data-type="svg" data-w="150" src="https://wechat2rss.xlab.app/img-proxy/?k=0cb1b678&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_svg%2FJCrjicctRMofgHPLnZN70OoBscLaJHbYicSic9NYy6gWYQIvtHJ485zkS6drDhFKaJxEjfM6WZK9lrSuAQibSG7Lqqicgjia72XaWu%2F640%3Fwx_fmt%3Dsvg"/></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;">获取请求参数</strong></p><pre style="margin: 0px;padding: 0px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;background-color: rgb(255, 255, 255);color: rgb(8, 8, 8);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 9.8pt;"><span style="color: rgb(0, 0, 0);"><strong><span style="margin: 0px;padding: 0px;">&lt;2&gt;</span>io.undertow.server.HttpServerExchange<span style="font-size: 9.8pt;letter-spacing: 0.544px;">#getQueryParameters</span></strong></span></pre><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.44473229706390327" data-s="300,640" style="" data-type="png" data-w="2316" src="https://wechat2rss.xlab.app/img-proxy/?k=805ee4d5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBXOnTTWia0IONv1EqxbuPH99Viam4sia0FfibHtNeyuqUnEHR7Y9I9GI5Apw%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><br/></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;font-size: 14px;overflow-wrap: break-word !important;">03</span></strong></p><p><img class="rich_pages wxw-img" data-ratio="1" data-type="svg" data-w="150" style="margin: 0px;padding: 0px;max-width: 100%;height: auto !important;vertical-align: middle;outline: 0px;box-sizing: border-box;overflow-wrap: break-word !important;width: 300px !important;visibility: visible !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=0cb1b678&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_svg%2FJCrjicctRMofgHPLnZN70OoBscLaJHbYicSic9NYy6gWYQIvtHJ485zkS6drDhFKaJxEjfM6WZK9lrSuAQibSG7Lqqicgjia72XaWu%2F640%3Fwx_fmt%3Dsvg"/></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;">截取http body</strong></p><pre style="margin: 0px;padding: 0px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;background-color: rgb(255, 255, 255);color: rgb(8, 8, 8);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 9.8pt;"><span style="margin: 0px;padding: 0px;color: rgb(0, 0, 0);"><strong style="margin: 0px;padding: 0px;"><span style="margin: 0px;padding: 0px;">&lt;3&gt; </span></strong></span>io.undertow.servlet.spec.ServletInputStreamImpl#read</pre><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.6495976591075348" data-s="300,640" style="" data-type="png" data-w="2734" src="https://wechat2rss.xlab.app/img-proxy/?k=71e9167c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBXWJzicsPMib7hibQ1HF0ZMdSPlXks4U2rMPB1IicD6gs7iakUlgCfp28ItFQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><br/></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;font-size: 14px;overflow-wrap: break-word !important;">04</span></strong></p><p><img class="rich_pages wxw-img" data-ratio="1" style="margin: 0px;padding: 0px;max-width: 100%;height: auto !important;vertical-align: middle;outline: 0px;box-sizing: border-box;overflow-wrap: break-word !important;width: 300px !important;visibility: visible !important;" data-type="svg" data-w="150" src="https://wechat2rss.xlab.app/img-proxy/?k=0cb1b678&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_svg%2FJCrjicctRMofgHPLnZN70OoBscLaJHbYicSic9NYy6gWYQIvtHJ485zkS6drDhFKaJxEjfM6WZK9lrSuAQibSG7Lqqicgjia72XaWu%2F640%3Fwx_fmt%3Dsvg"/></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;">清除线程变量</strong></p><pre style="margin: 0px;padding: 0px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;background-color: rgb(255, 255, 255);color: rgb(8, 8, 8);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 9.8pt;"><span style="margin: 0px;padding: 0px;color: rgb(0, 0, 0);"><strong style="margin: 0px;padding: 0px;"><span style="margin: 0px;padding: 0px;">&lt;4&gt; </span></strong></span>io.undertow.servlet.handlers.ServletInitialHandler</pre><pre style="margin: 0px;padding: 0px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;background-color: rgb(255, 255, 255);color: rgb(8, 8, 8);font-family: &#34;JetBrains Mono&#34;, monospace;font-size: 9.8pt;">#dispatchRequest</pre><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.38772455089820357" data-s="300,640" style="" data-type="png" data-w="2004" src="https://wechat2rss.xlab.app/img-proxy/?k=d9cb7e23&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBX2kInOpFVql7o97S6SgYpuMzuAoTzus5LRXEUVERXnW9zgUia0sWCNbA%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;">    <span style="font-size: 14px;">保存请求信息使用的是threadlocal，因为线程池的重用，在使用完成之后必须清除。</span><br/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;">打包插件</strong></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;">    打包好的jar包上传到对象存储服务中（或者可以提供下载的服务上，并获取下载链接）</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.535230352303523" data-s="300,640" style="" data-type="png" data-w="2952" src="https://wechat2rss.xlab.app/img-proxy/?k=cef14964&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBXTlcdwJmlUN0MPL46l7fcMq8CnO0dbpZjcsOERaheAVGcJKoeexDemA%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-weight: normal;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;clear: both;min-height: 1em;white-space: normal;overflow-wrap: break-word !important;"><br/></p><p style="font-weight: normal;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;clear: both;min-height: 1em;white-space: normal;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 14px;"><span style="color: rgb(51, 51, 51);font-family: -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#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-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">    并</span><span style="color: rgb(51, 51, 51);font-family: -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#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-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">且计算jar包的hash （linux 平台使用 md5sum <span style="color: rgb(51, 51, 51);font-family: -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#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-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">命</span><span style="color: rgb(51, 51, 51);font-family: -apple-system, &#34;system-ui&#34;, &#34;Helvetica Neue&#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-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;caret-color: rgb(51, 51, 51);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;display: inline !important;float: none;">令</span>、macos 使用md5命令，都是可以的，并且计算结果是一致的）。配置hash的原因是防止插件被篡改而加载后门等，保障插件的安全性。</span></span></p><p style="font-weight: normal;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;clear: both;min-height: 1em;white-space: normal;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 14px;"> </span></p><p style="font-weight: normal;text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.8273878020713463" data-s="300,640" style="" data-type="png" data-w="1738" src="https://wechat2rss.xlab.app/img-proxy/?k=4583e5fc&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBX8vD0KWW7N8MzV64QsBYgkoqlBowzdkpbBlBUV58UGvJn4eZiaPajV7w%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-weight: normal;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;clear: both;min-height: 1em;white-space: normal;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 14px;">如果插件有配置参数，也可以加上。</span></p><p style="font-weight: normal;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;clear: both;min-height: 1em;white-space: normal;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 14px;"><br/></span></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;white-space: normal;overflow-wrap: break-word !important;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;">新建配置与配置下发</strong></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;white-space: normal;overflow-wrap: break-word !important;"> </p><p style="text-align: left;margin-bottom: 0em;">新增配置，将其勾选上，然后下发到指定机器上（<span style="color: rgb(255, 0, 0);"><strong>无需重启java进程即可生效</strong></span>）</p><p style="text-align: left;margin-bottom: 0em;"><span style="font-family: -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;"></span><br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.8947040498442368" data-s="300,640" style="" data-type="png" data-w="1605" src="https://wechat2rss.xlab.app/img-proxy/?k=f6601a46&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBXEkfCwrbOicaThnrE0X56FnWJZLK5fDESargfWrbk2ogfAwxNtgJjjbQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: left;margin-bottom: 0em;"><br/></p><p style="text-align: left;margin-bottom: 0em;">配置下发：<br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5636242504996669" data-s="300,640" style="" data-type="png" data-w="3002" src="https://wechat2rss.xlab.app/img-proxy/?k=79b641c4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBXHxYAnZKm8vGuREUF33tqlg7PZfvFwEeKoD4owgNiazibZyGtvibCOVDyQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;margin-bottom: 0em;"><br/></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;white-space: normal;overflow-wrap: break-word !important;"><strong>测试插件是否生效</strong></p><p style="margin: 0px;padding: 0px;clear: both;min-height: 1em;outline: 0px;max-width: 100%;box-sizing: border-box;white-space: normal;overflow-wrap: break-word !important;"> 请求关联信息上报正常</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.6378205128205128" data-s="300,640" style="" data-type="png" data-w="3120" src="https://wechat2rss.xlab.app/img-proxy/?k=02f32102&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYPT1ZGMW6nurhSslo1icMMBXTHraXBr4SZdQkaFwrACMNubHH3JuiaPJB6l6Xq0C3Ccp13KWSFMpPaQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-weight: normal;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;clear: both;min-height: 1em;white-space: normal;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 14px;"><br/></span></p><p><svg viewBox="0 0 1 1" style="float:left;line-height:0;width:0;vertical-align:top;"></svg></p><p><img class="rich_pages wxw-img __bg_gif" data-ratio="0.1503268" data-type="gif" data-w="306" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;vertical-align: middle;height: auto !important;width: 45px;visibility: visible !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=fadc4f18&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_gif%2FKMrlKvwl2bmf57W4jZSbyQtcwibY2vdHiad7usGjFAC22x2uWceQsicljpCw6MJDbtIbuh25KyqFzLDn8dNt2bOsw%2F640%3Fwx_fmt%3Dgif"/></p><p><br/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;text-align: center;white-space: normal;"><br style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;"/></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;color: rgb(95, 156, 239);font-size: 12px;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;">关于jrasp</strong></span></p><ul class="list-paddingleft-1" style="list-style-type: disc;"><li><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-size: 12px;">如需获取更多信息，请访问我们的官网(http://jrasp.com)</span></p></li><li style="color: rgb(0, 0, 0);"><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;font-size: 12px;overflow-wrap: break-word !important;">使用请联系微信</span><span style="color: rgb(0, 0, 0);font-size: 12px;font-family: -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;">：sear2022</span></span></p></li></ul><p><br/></p>




]]></content:encoded>
      <pubDate>Sun, 12 Jun 2022 19:16:47 +0800</pubDate>
    </item>
    <item>
      <title>RASP | 从0到1给企业安装JRASP</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484300&amp;idx=1&amp;sn=396f260ae094164471ac66770f4f6698</link>
      <description>jrasp系统各个组件，均提供一键部署的脚本，免去各种复杂环境配置，降低运维安装压力。</description>
      <content:encoded><![CDATA[<p>
<span>Hsin Tsao</span> <span>2022-06-03 12:03</span> <span style="display: inline-block;">江苏</span>
</p>

<p>jrasp系统各个组件，均提供一键部署的脚本，免去各种复杂环境配置，降低运维安装压力。</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=741c8a96&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYMc5DVyJbrhhNIN4Rj1XZ8ZHVft1hrAms0N7knhJMfIWchiaKSxic30L2tDaiciaSTnordz7lsGNOfnxw%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p><span style="font-size: 24px;"><strong>1.系统安装<br/></strong></span></p><p>    jrasp系统各个组件，均提供一键部署的脚本，免去各种复杂环境配置，降低运维安装压力。全部安装过程大约耗时<strong>30分钟</strong>。<br/></p><p><strong><code><span style="font-size: 17px;">## jdk8安装</span></code></strong></p><p><code><span style="text-decoration: underline;font-size: 15px;">http://www.jrasp.com/developer/software.html</span></code><code><span style="font-size: 15px;"> </span></code></p><p><strong><code>## 安装zookeeper集群</code></strong><code><span style="font-size: 15px;"><br/></span></code></p><p><code><span style="font-size: 15px;">节点1: 10.8.0.4（内网） 4c8g30g<br/>节点2: 10.8.0.5（<code>内网</code>） 4c8g30g<br/>节点3: 10.8.0.6（<code>内网</code>） 4c8g30g<br/></span></code></p><p><span style="font-size: 15px;">一键安装脚本</span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="makefile"><code><span class="code-snippet_outer">## 下载解压</span></code><code><span class="code-snippet_outer">mkdir -p /opt/zookeeper;</span></code><code><span class="code-snippet_outer">mkdir -p /tmp/zookeeper; </span></code><code><span class="code-snippet_outer">wget https://repo.huaweicloud.com/apache/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz;</span></code><code><span class="code-snippet_outer">tar -zxvf apache-zookeeper-3.7.0-bin.tar.gz -C /opt/zookeeper;       </span></code><code><span class="code-snippet_outer">mkdir -p /opt/zookeeper;</span></code><code><span class="code-snippet_outer">mkdir -p /tmp/zookeeper;        </span></code><code><span class="code-snippet_outer">## 配置zoo.cfg</span></code><code><span class="code-snippet_outer">cat &lt;&lt; EOF &gt; /opt/zookeeper/apache-zookeeper-3.7.0-bin/conf/zoo.cfg;</span></code><code><span class="code-snippet_outer">tickTime=2000</span></code><code><span class="code-snippet_outer">initLimit=10</span></code><code><span class="code-snippet_outer">syncLimit=5</span></code><code><span class="code-snippet_outer">dataDir=/tmp/zookeeper</span></code><code><span class="code-snippet_outer">clientPort=2181</span></code><code><span class="code-snippet_outer">server.1=10.8.0.4:2888:3888</span></code><code><span class="code-snippet_outer">server.2=10.8.0.5:2888:3888</span></code><code><span class="code-snippet_outer">server.3=10.8.0.6:2888:3888</span></code><code><span class="code-snippet_outer">EOF</span></code><code><span class="code-snippet_outer">## myid</span></code><code><span class="code-snippet_outer">cat &lt;&lt; EOF &gt; /tmp/zookeeper/myid;</span></code><code><span class="code-snippet_outer">1</span></code><code><span class="code-snippet_outer">EOF</span></code><code><span class="code-snippet_outer">##  自动拉起与开启启动       </span></code><code><span class="code-snippet_outer">cat &lt;&lt; EOF &gt; /usr/lib/systemd/system/zookeeper.service;</span></code><code><span class="code-snippet_outer">[Unit]</span></code><code><span class="code-snippet_outer">Description=Zookeeper server manager</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">[Service]</span></code><code><span class="code-snippet_outer">Type=forking</span></code><code><span class="code-snippet_outer">Environment=JAVA_HOME=/usr/local/java/jdk1.8.0_181</span></code><code><span class="code-snippet_outer">ExecStart=/opt/zookeeper/apache-zookeeper-3.7.0-bin/bin/zkServer.sh start</span></code><code><span class="code-snippet_outer">ExecStop=/opt/zookeeper/apache-zookeeper-3.7.0-bin/bin/zkServer.sh stop</span></code><code><span class="code-snippet_outer">ExecReload=/opt/zookeeper/apache-zookeeper-3.7.0-bin/bin/zkServer.sh restart</span></code><code><span class="code-snippet_outer">Restart=always</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">[Install]</span></code><code><span class="code-snippet_outer">WantedBy=multi-user.target</span></code><code><span class="code-snippet_outer">EOF</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">systemctl daemon-reload</span></code><code><span class="code-snippet_outer">systemctl enable zookeeper</span></code><code><span class="code-snippet_outer">systemctl start zookeeper</span></code><code><span class="code-snippet_outer">systemctl stop zookeeper</span></code><code><span class="code-snippet_outer">systemctl restart zookeeper</span></code><code><span class="code-snippet_outer">systemctl status zookeeper</span></code></pre><p><span style="font-size: 12px;">（复制上面的命令在终端执行即可）</span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p><span style="font-size: 15px;">需要注意的是：/tmp/zookeeper/myid文件的节点编号每个节点不一样，依次为</span></p><p><span style="font-size: 15px;">1、2、3</span></p></li><li><p><span style="font-size: 15px;">安装结果验证：观察 /opt/zookeeper/apache-zookeeper-3.7.0-bin/logs/zookeeper--server-{机器名称}.log  是否有错误日志，没有就是安装成功。</span><br/></p></li></ul><p><strong>## 安装kafka集群（与zk在同一机器上）<br/></strong></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="makefile"><code><span class="code-snippet_outer"><span class="code-snippet__comment">## 下载解压</span></span></code><code><span class="code-snippet_outer">mkdir -p /opt/kafka;        </span></code><code><span class="code-snippet_outer">wget https://repo.huaweicloud.com/apache/kafka/2.8.0/kafka_2.13-2.8.0.tgz;</span></code><code><span class="code-snippet_outer">tar -zxvf kafka_2.13-2.8.0.tgz -C /opt/kafka;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">## 配置server.properties</span></span></code><code><span class="code-snippet_outer">cat &lt;&lt; EOF &gt; /opt/kafka/kafka_2.13-2.8.0/config/server.properties;</span></code><code><span class="code-snippet_outer">broker.id=1</span></code><code><span class="code-snippet_outer">listeners=PLAINTEXT://10.8.0.4:9092</span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">advertised.listeners=PLAINTEXT://{公网ip}:9092</span></span></code><code><span class="code-snippet_outer">num.network.threads=3</span></code><code><span class="code-snippet_outer">num.io.threads=8</span></code><code><span class="code-snippet_outer">socket.send.buffer.bytes=102400</span></code><code><span class="code-snippet_outer">socket.receive.buffer.bytes=102400</span></code><code><span class="code-snippet_outer">socket.request.max.bytes=104857600</span></code><code><span class="code-snippet_outer">log.dirs=/tmp/kafka-logs</span></code><code><span class="code-snippet_outer">num.partitions=1</span></code><code><span class="code-snippet_outer">num.recovery.threads.per.data.dir=1</span></code><code><span class="code-snippet_outer">offsets.topic.replication.factor=1</span></code><code><span class="code-snippet_outer">transaction.state.log.replication.factor=1</span></code><code><span class="code-snippet_outer">transaction.state.log.min.isr=1</span></code><code><span class="code-snippet_outer">log.retention.hours=168</span></code><code><span class="code-snippet_outer">log.segment.bytes=1073741824</span></code><code><span class="code-snippet_outer">log.retention.check.interval.ms=300000</span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">zookeeper.connect=10.8.0.4:2181,10.8.0.5:2181,10.8.0.6:2181</span></span></code><code><span class="code-snippet_outer">zookeeper.connection.timeout.ms=18000</span></code><code><span class="code-snippet_outer">group.initial.rebalance.delay.ms=0</span></code><code><span class="code-snippet_outer">EOF</span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">##  自动拉起与开启启动       </span></span></code><code><span class="code-snippet_outer">cat &lt;&lt; EOF &gt; /usr/lib/systemd/system/kafka.service;</span></code><code><span class="code-snippet_outer">[Unit]</span></code><code><span class="code-snippet_outer">Description=kafka service</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">[Service]</span></code><code><span class="code-snippet_outer">Type=simple</span></code><code><span class="code-snippet_outer">Environment=JAVA_HOME=/usr/local/java/jdk1.8.0_181</span></code><code><span class="code-snippet_outer">ExecStart=/opt/kafka/kafka_2.13-2.8.0/bin/kafka-server-start.sh /opt/kafka/kafka_2.13-2.8.0/config/server.properties</span></code><code><span class="code-snippet_outer">ExecStop=/opt/kafka/kafka_2.13-2.8.0/bin/kafka-server-stop.sh</span></code><code><span class="code-snippet_outer">Restart=always</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">[Install]</span></code><code><span class="code-snippet_outer">WantedBy=multi-user.target</span></code><code><span class="code-snippet_outer">EOF</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">systemctl daemon-reload</span></code><code><span class="code-snippet_outer">systemctl enable kafka</span></code><code><span class="code-snippet_outer">systemctl stop kafka        </span></code><code><span class="code-snippet_outer">systemctl start kafka</span></code><code><span class="code-snippet_outer">systemctl status kafka</span></code></pre><p><span style="font-size: 15px;"> 执行上面的脚本前，请修改broker.id、listeners、advertised.listeners、zookeeper.connect为对应zk节点信息</span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p><span style="font-size: 15px;">broker.id 是节点编号依次为1、2、3<br/></span></p></li><li><p><span style="font-size: 15px;">listeners 是该节点的内网地址</span></p></li><li><p><span style="font-size: 15px;">advertised.listeners 是该节点的外网地址</span></p></li><li><p><span style="font-size: 15px;">zookeeper.connect 是zk集群的节点内网地址</span><br/></p><p><br/></p></li></ul><p><span style="font-size: 15px;">安装验证：查看各个节点的日志是否有错误信息：/opt/kafka/kafka_2.13-2.8.0/logs/server.log<br/></span></p><p>创建 jrasp-daemon、jrasp-agent、jrasp-module 三个 topic<span style="font-size: 15px;"></span></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer"><span class="code-snippet__comment">### topic 创建</span></span></code><code><span class="code-snippet_outer">./kafka-topics.sh --zookeeper <span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">4</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span>,<span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">5</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span>,<span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">6</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span> --create --topic jrasp-daemon --partitions <span class="code-snippet__number">3</span> --replication-factor <span class="code-snippet__number">3</span></span></code><code><span class="code-snippet_outer">./kafka-topics.sh --zookeeper <span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">4</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span>,<span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">5</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span>,<span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">6</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span> --create --topic jrasp-agent --partitions <span class="code-snippet__number">3</span> --replication-factor <span class="code-snippet__number">3</span></span></code><code><span class="code-snippet_outer">./kafka-topics.sh --zookeeper <span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">4</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span>,<span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">5</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span>,<span class="code-snippet__number">10.8</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">6</span><span class="code-snippet__symbol">:</span><span class="code-snippet__number">2181</span> --create --topic jrasp-<span class="code-snippet__class"><span class="code-snippet__keyword">module</span> --<span class="code-snippet__title">partitions</span> 3 --<span class="code-snippet__title">replication</span>-<span class="code-snippet__title">factor</span> 3</span></span></code></pre><p>误操作时执行：<br/></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">./kafka-topics.sh --zookeeper <span class="code-snippet__number">10.8</span><span class="code-snippet__number">.0</span><span class="code-snippet__number">.4</span>:<span class="code-snippet__number">2181</span>,<span class="code-snippet__number">10.8</span><span class="code-snippet__number">.0</span><span class="code-snippet__number">.5</span>:<span class="code-snippet__number">2181</span>,<span class="code-snippet__number">10.8</span><span class="code-snippet__number">.0</span><span class="code-snippet__number">.6</span>:<span class="code-snippet__number">2181</span> --<span class="code-snippet__keyword">delete</span>  --topic jrasp-daemon</span></code><code><span class="code-snippet_outer"><br/></span></code></pre><p><strong>## nacos 安装<br/></strong></p><p><span style="font-size: 15px;">整个公司机器数量在200台左右，单个节点可以支持</span><br/></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer"><span class="code-snippet__attribute">wget</span> https://jrasp-daemon-1254321150.cos.ap-shanghai.myqcloud.com/nacos-server-2.0.3.tar.gz;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__attribute">tar</span> -zxvf nacos-server-<span class="code-snippet__number">2</span>.<span class="code-snippet__number">0</span>.<span class="code-snippet__number">3</span>.tar.gz -C /opt/;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__attribute">cd</span> /opt/nacos/bin;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__attribute">sh</span> startup.sh -m standalone</span></code></pre><p><br/></p><p><strong>## 管理端安装 （目前不开放，联系我们免费获取）</strong>## mysql 数据库安装初始化 mysql5.7### 后台安装    springboot+ security### 前端安装   antd design pro +nginx<br/></p><p><strong>## jrasp-agent 安装<br/></strong></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="properties"><code><span class="code-snippet_outer"><span class="code-snippet__comment">## 安装包下载</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">wget</span>  <span class="code-snippet__string">https://jrasp-daemon-1254321150.cos.ap-shanghai.myqcloud.com/2022-05-05/1.0.4/jrasp-1.0.4.tar.gz</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">tar</span> <span class="code-snippet__string">-xvf jrasp-1.0.4.tar.gz -C /usr/local/</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">## 配置守护进程        </span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">cat</span> <span class="code-snippet__string">&lt;&lt; EOF &gt; /usr/lib/systemd/system/jrasp-daemon.service</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">[Unit]</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">Description</span>=<span class="code-snippet__string">jrasp-daemon service</span></span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">[Service]</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">Type</span>=<span class="code-snippet__string">simple</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">WorkingDirectory</span>=<span class="code-snippet__string">/usr/local/jrasp/bin</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">ExecStart</span>=<span class="code-snippet__string">/usr/local/jrasp/bin/startup.sh</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">ExecStop</span>=<span class="code-snippet__string">/usr/local/jrasp/bin/shutdown.sh</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">Restart</span>=<span class="code-snippet__string">always</span></span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">[Install]</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">WantedBy</span>=<span class="code-snippet__string">multi-user.target</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">EOF</span></span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">## 设置开机启动与自动拉起</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">systemctl</span> <span class="code-snippet__string">daemon-reload;</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">systemctl</span> <span class="code-snippet__string">enable jrasp-daemon.service;</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">systemctl</span> <span class="code-snippet__string">stop jrasp-daemon.service;</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">systemctl</span> <span class="code-snippet__string">start jrasp-daemon.service;</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">systemctl</span> <span class="code-snippet__string">status jrasp-daemon.service;</span></span></code><code><span class="code-snippet_outer"><br/></span></code></pre><p><strong>## filebeat 一键安装<br/></strong></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="makefile"><code><span class="code-snippet_outer"><span class="code-snippet__comment">## 日志目录</span></span></code><code><span class="code-snippet_outer">logDir=/usr/local/jrasp/logs</span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">## fileBeat 安装目录</span></span></code><code><span class="code-snippet_outer">fileBeatHome=/opt/filebeat</span></code><code><span class="code-snippet_outer">cd /opt/ &amp;&amp; yum install wget -y &amp;&amp; wget https://repo.huaweicloud.com/filebeat/7.9.1/filebeat-7.9.1-linux-x86_64.tar.gz;</span></code><code><span class="code-snippet_outer">tar -zxvf filebeat-7.9.1-linux-x86_64.tar.gz -C /opt/ &amp;&amp; mv filebeat-7.9.1-linux-x86_64 filebeat &amp;&amp; rm -rf filebeat-7.9.1-linux-x86_64.tar.gz;</span></code><code><span class="code-snippet_outer">cat &lt;&lt; EOF &gt; ${fileBeatHome}/filebeat.yml</span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">filebeat.inputs:</span></span></code><code><span class="code-snippet_outer">- type: log</span></code><code><span class="code-snippet_outer">  fields:</span></code><code><span class="code-snippet_outer">        kafka_topic: <span class="code-snippet__string">&#34;jrasp-daemon&#34;</span></span></code><code><span class="code-snippet_outer">  paths:</span></code><code><span class="code-snippet_outer">    - ${logDir}/jrasp-daemon.log</span></code><code><span class="code-snippet_outer">- type: log</span></code><code><span class="code-snippet_outer">  fields:</span></code><code><span class="code-snippet_outer">        kafka_topic: <span class="code-snippet__string">&#34;jrasp-agent&#34;</span></span></code><code><span class="code-snippet_outer">  paths:</span></code><code><span class="code-snippet_outer">    - ${logDir}/jrasp-agent.log</span></code><code><span class="code-snippet_outer">- type: log</span></code><code><span class="code-snippet_outer">  fields:</span></code><code><span class="code-snippet_outer">        kafka_topic: <span class="code-snippet__string">&#34;jrasp-module&#34;</span></span></code><code><span class="code-snippet_outer">  paths:</span></code><code><span class="code-snippet_outer">    - ${logDir}/jrasp-module.log</span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">filebeat.config.modules:</span></span></code><code><span class="code-snippet_outer">  path: \${path.config}/modules.d/*.yml</span></code><code><span class="code-snippet_outer">  reload.enabled: false</span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">setup.template.settings:</span></span></code><code><span class="code-snippet_outer">  index.number_of_shards: 1</span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">output.kafka:</span></span></code><code><span class="code-snippet_outer">  enabled: true</span></code><code><span class="code-snippet_outer">  hosts: [<span class="code-snippet__string">&#34;kafka_ip_1:9092&#34;</span>,<span class="code-snippet__string">&#34;kafka_ip_2:9092&#34;</span>,<span class="code-snippet__string">&#34;kafka_ip_3:9092&#34;</span>]</span></code><code><span class="code-snippet_outer">  topic: &#39;%{[fields.kafka_topic]}&#39;</span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">processors:</span></span></code><code><span class="code-snippet_outer">  - add_host_metadata:</span></code><code><span class="code-snippet_outer">      when.not.contains.tags: forwarded</span></code><code><span class="code-snippet_outer">  - add_cloud_metadata: ~</span></code><code><span class="code-snippet_outer">  - add_docker_metadata: ~</span></code><code><span class="code-snippet_outer">  - add_kubernetes_metadata: ~</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">processors:</span></span></code><code><span class="code-snippet_outer">  - decode_json_fields:</span></code><code><span class="code-snippet_outer">      fields: [&#39;message&#39;]</span></code><code><span class="code-snippet_outer">      target: &#39;&#39;</span></code><code><span class="code-snippet_outer">      overwrite_keys: true</span></code><code><span class="code-snippet_outer">  - drop_fields:</span></code><code><span class="code-snippet_outer">      fields: [<span class="code-snippet__string">&#34;host&#34;</span>,<span class="code-snippet__string">&#34;agent&#34;</span>,<span class="code-snippet__string">&#34;log&#34;</span>,<span class="code-snippet__string">&#34;input&#34;</span>,<span class="code-snippet__string">&#34;ecs&#34;</span>,<span class="code-snippet__string">&#34;@timestamp&#34;</span>]</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer"><span class="code-snippet__section">logging.level: info</span></span></code><code><span class="code-snippet_outer">EOF</span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment">## systemctl</span></span></code><code><span class="code-snippet_outer">cat &lt;&lt; EOF &gt; /usr/lib/systemd/system/filebeat.service</span></code><code><span class="code-snippet_outer">[Unit]</span></code><code><span class="code-snippet_outer">Description=filebeat</span></code><code><span class="code-snippet_outer">Wants=network-online.target</span></code><code><span class="code-snippet_outer">After=network-online.target</span></code><code><span class="code-snippet_outer">[Service]</span></code><code><span class="code-snippet_outer">User=root</span></code><code><span class="code-snippet_outer">ExecStart=${fileBeatHome}/filebeat -c ${fileBeatHome}/filebeat.yml</span></code><code><span class="code-snippet_outer">Restart=always</span></code><code><span class="code-snippet_outer">[Install]</span></code><code><span class="code-snippet_outer">WantedBy=multi-user.target</span></code><code><span class="code-snippet_outer">EOF</span></code><code><span class="code-snippet_outer">systemctl daemon-reload &amp;&amp; systemctl enable filebeat.service;</span></code><code><span class="code-snippet_outer">systemctl stop filebeat.service &amp;&amp; systemctl start filebeat.service;</span></code><code><span class="code-snippet_outer">systemctl status filebeat.service;</span></code><code><span class="code-snippet_outer"><br/></span></code></pre><p><span style="font-size: 24px;"><strong>2.管理端配置<br/></strong></span></p><p><span style="font-size: 15px;"><strong>安全总览</strong></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.2741823242867084" data-s="300,640" data-type="png" data-w="2874" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=432e8679&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMc5DVyJbrhhNIN4Rj1XZ8ZhicakF88zTMHpgHNbRp76ibic6tU0GZajVzehjAciafSS92Qkpnnsj2skw%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="font-size: 15px;"><strong><span style="font-size: 15px;"><strong><br/></strong></span></strong></span></p><p><span style="font-size: 15px;"><strong><span style="font-size: 15px;"><strong>实例管理</strong></span></strong></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.44786564030790765" data-s="300,640" data-type="png" data-w="2858" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=1b8dc3b4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMc5DVyJbrhhNIN4Rj1XZ8ZRcGywRWLWv0bptxdZFic1pGYczLMOoIJKKOqMibwt4I25BnHkicwORdsg%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="font-size: 15px;"><strong>主机详情<br/></strong></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.620050547598989" data-s="300,640" data-type="png" data-w="2374" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=a4bb6b37&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMc5DVyJbrhhNIN4Rj1XZ8ZG6XdwawLpO2stdzNbib2R4m72foPNkbEqpgCCLWbOf8c5joeMneBTiaQ%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="font-size: 12px;"> (用户机器配置较高，一台上机器上安装较多服务)<strong><br/></strong></span></p><p><span style="font-size: 15px;"><strong>策略配置</strong></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.47671994440583737" data-s="300,640" data-type="png" data-w="2878" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=711070f0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMc5DVyJbrhhNIN4Rj1XZ8Z5PScdBeFKplaVtXehuBp5orAMgxQeiccvBJaIJQDlXjyBP4XWv0cNLg%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="font-size: 15px;"><strong>插件管理</strong></span></p><p><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5443745632424878" data-s="300,640" data-type="png" data-w="2862" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=2ae63d3d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMc5DVyJbrhhNIN4Rj1XZ8ZzANgYbS1Fu6mQaeoNIbMQQW3Z6xBOqSd81njKBkto5haAgNjN9Y6mg%2F640%3Fwx_fmt%3Dpng"/><br/></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p><span style="font-size: 12px;">用户使用的web容器是 undertow，我们临时开发了这个插件 ；<br/></span></p></li><li><p><span style="font-size: 12px;">其他插件会陆续上线，增强系统安全能力，值得一提的是，新插件上线无需用户重启服务；</span></p><p><br/></p></li></ul><p>攻击日志</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5494428969359332" data-s="300,640" data-type="png" data-w="2872" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=4b9df3fe&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMc5DVyJbrhhNIN4Rj1XZ8ZFF4fjotWMaxz7mIaQ5Q7jnSrUJe9xqVCDBH06iayibxuficJSRw4BJcNA%2F640%3Fwx_fmt%3Dpng"/></p><p><br/></p><p>   测试环境目前安装了<strong><span style="text-decoration: underline;">18</span></strong>台机器，稳定运行，漏洞测试拦截符合预期，用户反馈不错。<br/></p><p>申请试用请联系：<strong>sear2022</strong>，提供技术支持。<br/></p>




]]></content:encoded>
      <pubDate>Fri, 03 Jun 2022 12:03:02 +0800</pubDate>
    </item>
    <item>
      <title>RASP | FastJson反序列化漏洞回顾</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484289&amp;idx=1&amp;sn=930cc2e69426762372824dadfc66ea02</link>
      <description>与原生的Java反序列化的区别在于，FastJson反序列化并未使用readObject()方法，而是通过在反序列化的过程中调用setter/getter方法，将JSON字符串还原成对象，漏洞产生在自动调用的方法中。</description>
      <content:encoded><![CDATA[<p>
<span>Hsin Tsao</span> <span>2022-05-29 15:23</span> <span style="display: inline-block;">江苏</span>
</p>

<p>与原生的Java反序列化的区别在于，FastJson反序列化并未使用readObject()方法，而是通过在反序列化的过程中调用setter/getter方法，将JSON字符串还原成对象，漏洞产生在自动调用的方法中。</p>


<p style="margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;margin-left: 8px;margin-right: 8px;">
<img src="https://wechat2rss.xlab.app/img-proxy/?k=507f6b73&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH84ZAC8pmcg2voOSQSSeyFaLgyWKbhibogpcvROJxaicsqGKh6WCWbsjzw%2F0%3Fwx_fmt%3Djpeg"/>
</p>

<p style="white-space: normal;">    与原生的Java反序列化的区别在于，FastJson反序列化并未使用</p><p style="white-space: normal;">ObjectInputStream.readObject()方法，而是由FastJson自定一套反序列化的过程。通过在反序列化的过程中自动调用类属性的setter/getter方法，将JSON字符串还原成对象，当这些自动调用的方法中存在可利用的潜在危险代码时，漏洞便产生了。</p><p style="white-space: normal;"><br/></p><ol class="list-paddingleft-1" style="width: 577.422px;white-space: normal;"><li style="font-weight: bold;font-size: 20px;"><p><strong>FastJson反序列化漏洞的演变历程</strong></p></li></ol><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5948905109489051" data-s="300,640" style="height: auto !important;" data-type="png" data-w="2192" src="https://wechat2rss.xlab.app/img-proxy/?k=f7c27061&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH8Qxsib21GCdGlZOeYjSGuic0cU9z8LptLxMficR8A9RZam55uT21UbeP7Q%2F640%3Fwx_fmt%3Dpng"/></p><ul class="list-paddingleft-1" style="width: 577.422px;white-space: normal;"><li><p>自从2017年爆出FastJson1.2.24版本反序列化漏洞后，近几年安全人员在不断寻找新的利用方式。</p></li><li><p>自FastJson1.2.25版本开始，FastJson关闭了默认开启的AutoType，并且内置了一个黑名单，用于防止存在风险的类进行序列化。</p></li><li><p>由于FastJson 1.2.41版本和1.2.42版本对类名处理不当，导致黑名单机制被绕过，在修复该漏洞的同时还将黑名单进行加密，增加了研究成本。</p></li><li><p>在FastJson1.2.45版本中，研究人员发现新的可利用的类，且不在黑名单中。</p></li><li><p>在FastJson1.2.47版本中，研究人员发现通过缓存机制，能够绕过AutoType的限制和黑名单机制。</p></li><li><p>在2020年，FastJson1.2.68版本又被发现新的绕过AutoType的方式，也是通过缓存的方式绕过，但具体成因的代码逻辑有些差异，利用难度也较先前版本更大。</p></li><li><p>在2022年5月，FastJson1.2.80版本又被发现新的绕过AutoType的方式。</p></li></ul><p style="white-space: normal;">    </p><p style="white-space: normal;">    从上述FastJson反序列化漏洞可以看出漏洞利用主要集中在如下的2个方面。</p><ul class="list-paddingleft-1" style="width: 577.422px;white-space: normal;"><li><p>寻找新的利用链，绕过黑名单；</p></li><li><p>寻找绕过AutoType的方式；</p></li></ul><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><span style="font-size: 20px;"><strong>2.  FastJson反序列化漏洞的基础</strong></span></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;">FastJson将JSON还原成对象的方法有以下3种。</p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="typescript"><code><span class="code-snippet_outer">parse(String text);</span></code><code><span class="code-snippet_outer">parseObject(String text);</span></code><code><span class="code-snippet_outer">parseObject(String input, Class clazz);</span></code></pre><p style="white-space: normal;">    当通过这3种方法将JSON还原成对象时，FastJson自动调用类中的setter方法和无参构造函数，以及满足条件的getter方法。当类中定义的属性和方法满足下列要求时，FastJson会自动调用getter方法。</p><ol class="list-paddingleft-1" style="width: 577.422px;white-space: normal;"><li><p>只存在getter方法，无setter方法;</p></li><li><p>方法名称长度大于等于4;</p></li><li><p>非静态方法;</p></li><li><p>方法名以get开头，且第四个字符为大写字母，例如getAge;</p></li><li><p>方法无须人参;</p></li><li><p>方法返回值继承自Collection、Map、AtomicBoolean、AtomicInteger和</p></li></ol><p style="white-space: normal;">AtomicLong的其中一个;</p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><span style="color: rgb(255, 0, 0);">FastJson 1.2.24</span> 下的PoC 如下：<br/></p><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="cs"><code><span class="code-snippet_outer">import com.alibaba.fastjson.JSON;</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">import java.util.Properties;</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">public class User {</span></code><code><span class="code-snippet_outer">    public String name;</span></code><code><span class="code-snippet_outer">    private int age;</span></code><code><span class="code-snippet_outer">    private Boolean sex;</span></code><code><span class="code-snippet_outer">    private Properties properties;</span></code><code><span class="code-snippet_outer">    public User() {</span></code><code><span class="code-snippet_outer">        System.out.println(&#34;无参构造函数调用&#34;);</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    public int getAge() {</span></code><code><span class="code-snippet_outer">        System.out.println(&#34;age的getter方法调用&#34;);</span></code><code><span class="code-snippet_outer">        return age;</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    public void setAge(int age) {</span></code><code><span class="code-snippet_outer">        System.out.println(&#34;age的setter方法调用&#34;);</span></code><code><span class="code-snippet_outer">        this.age = age;</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    public Properties getProperties() {</span></code><code><span class="code-snippet_outer">        System.out.println(&#34;properties的getter方法调用&#34;);</span></code><code><span class="code-snippet_outer">        return properties;</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    public void setName(String name) {</span></code><code><span class="code-snippet_outer">        System.out.println(&#34;name的setter方法调用&#34;);</span></code><code><span class="code-snippet_outer">        this.name = name;</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    public String getName() {</span></code><code><span class="code-snippet_outer">        System.out.println(&#34;name的getter方法调用&#34;);</span></code><code><span class="code-snippet_outer">        return name;</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    public void setSex(Boolean sex) {</span></code><code><span class="code-snippet_outer">        System.out.println(&#34;sex的setter方法调用&#34;);</span></code><code><span class="code-snippet_outer">        this.sex = sex;</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    public Boolean getSex() {</span></code><code><span class="code-snippet_outer">        System.out.println(&#34;sex的getter方法调用&#34;);</span></code><code><span class="code-snippet_outer">        return sex;</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">    public static void main(String[] args) {</span></code><code><span class="code-snippet_outer">        String jsonstr = &#34;{\&#34;@type\&#34;:\&#34;User\&#34;,\&#34;sex\&#34;:true,\&#34;name\&#34;:\&#34;Yu\&#34;,\&#34;age\&#34;:18,\&#34;properties\&#34;:{}}&#34;;</span></code><code><span class="code-snippet_outer">        Object obj = JSON.parse(jsonstr);</span></code><code><span class="code-snippet_outer">    }</span></code><code><span class="code-snippet_outer">}</span></code></pre><p style="white-space: normal;">PoC执行结果：<br/></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.33691756272401435" data-s="300,640" style="height: auto !important;" data-type="png" data-w="1116" src="https://wechat2rss.xlab.app/img-proxy/?k=b8d29002&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH8GScQWG8d3FgCleaOiaBn7mwnNbZBBibcsP67tK0re7CuWicD2OCVicXMUA%2F640%3Fwx_fmt%3Dpng"/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;">    parseObject(String text)方法将SON申还原成对象后，后会调用一次getter方法，类中所有的getter方法都会被执行一次，如下图所示：</p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.1441340782122905" data-s="300,640" style="height: auto !important;" data-type="png" data-w="1790" src="https://wechat2rss.xlab.app/img-proxy/?k=9ead4e09&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH8I34clr7MmVgIvN3MJdwUMUGu564zQIKT13yyN4kzGKxjUZ3HLCA9yw%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5095238095238095" data-s="300,640" style="width: 569px;height: auto !important;" data-type="png" data-w="840" src="https://wechat2rss.xlab.app/img-proxy/?k=13f38a82&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH8ltkNC2FkXP8QoTrcgl9TfI3WgdklT70YCn9wCoibp2mJGz2uY5zRJhQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><span style="font-size: 20px;"><strong>3. checkAutoType 安全机制</strong></span></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;">    FastJson1.2.25版本中引人了checkAutotype，其中增加了黑白名单的校，验，缓解反序列化需洞的产生，后续版本将内置的黑白名单进行加密，增加了绕过黑白名的研究成本。</p><p style="white-space: normal;"><span style="text-align: start;font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;white-space: pre-wrap;background-color: rgb(255, 255, 255);">    com.alibaba.fastjson.parser.ParserConfig 加入了CheckAutoType方法,</span><span style="font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;text-align: start;white-space: pre-wrap;background-color: rgb(255, 255, 255);">在其中有个 autotypeSupport 属性，如果为 false，那么就会检测json中@type的值 开头是否与黑名单中的值一样，若一样就直接返回一个异常，然后加载白名单中的类。</span></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.05665529010238908" data-s="300,640" data-type="png" data-w="2930" style="height: auto !important;" src="https://wechat2rss.xlab.app/img-proxy/?k=ffb0f4d5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH8ldC5cMYqZmW94jjRGCiaC2CRIMut2If8JA998gKicZNkV5q8HiaOel48Q%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 0em;white-space: normal;text-align: left;"><span style="font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;white-space: pre-wrap;background-color: rgb(255, 255, 255);">黑名单长这样：</span></p><p style="margin-bottom: 0em;white-space: normal;text-align: left;"><img class="rich_pages wxw-img" data-ratio="0.782051282051282" style="caret-color: rgb(0, 0, 0);color: rgb(0, 0, 0);cursor: zoom-in;height: auto !important;" data-type="png" data-w="390" src="https://wechat2rss.xlab.app/img-proxy/?k=33353cfe&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH8UqFqbMvIDFFAJUe5BLnuaJtPOOBpQo5uMfCmsVEK3UYkscBrTfna0g%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 0em;white-space: normal;text-align: left;"><span style="font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;white-space: pre-wrap;background-color: rgb(255, 255, 255);">CheckAutoType() 部分代码</span></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.2939166097060834" data-s="300,640" style="height: auto !important;" data-type="png" data-w="2926" src="https://wechat2rss.xlab.app/img-proxy/?k=75f79d09&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH8EaAGICNaA1oichopibWr9EDsHQXUB1lOQNk4GNHUpz5QGia2wHXvpmic4g%2F640%3Fwx_fmt%3Dpng"/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><strong style="text-align: start;box-sizing: border-box;list-style: inherit;font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;font-size: 14px;white-space: pre-wrap;">若autotypesupport开启，则会先白名单加载，后黑名单检测</strong></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.40190249702734837" data-s="300,640" style="height: auto !important;" data-type="png" data-w="1682" src="https://wechat2rss.xlab.app/img-proxy/?k=0ca46b3a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMPUVVReG4kWQibaUeOo8eH8fvic7hQu9HGvAynk3gFVDFekcibWG0iaKgav9qpd4bGy0jRd205ch0OmQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="white-space: normal;"><span style="text-align: start;font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;font-size: 14px;white-space: pre-wrap;background-color: rgb(255, 255, 255);">    </span></p><p style="white-space: normal;"><span style="text-align: start;font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;white-space: pre-wrap;background-color: rgb(255, 255, 255);">    后面的许多更新都是对 checkAutotype 以及本身某些逻辑缺陷导致的漏洞进行修复，以及黑名单的不断增加。</span></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><span style="text-align: start;font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;white-space: pre-wrap;background-color: rgb(255, 255, 255);font-size: 20px;"><strong style="white-space: normal;">4. RASP 防御</strong></span></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><span style="text-align: start;font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;white-space: pre-wrap;background-color: rgb(255, 255, 255);"><strong style="white-space: normal;">1.2.47 版本的漏洞利用与RASP 防御</strong></span></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><span style="text-align: start;font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;white-space: pre-wrap;background-color: rgb(255, 255, 255);font-size: 12px;">复现参考：https://mp.weixin.qq.com/s/A0X3nCq9w4BAlGPCN-jH5Q</span></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;">受到漏洞影响的服务注册到管理端：</p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.2309433962264151" data-s="300,640" style="height: auto !important;" data-type="png" data-w="2650" src="https://wechat2rss.xlab.app/img-proxy/?k=9b11d057&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMKibL2lhNoPiaHDnbSicUBd1icxaia76DzZoDntKP4JEGbh4hOZ3q1sv1d4sKnb4n0KyCsxIfBBaNeBmg%2F640%3Fwx_fmt%3Dpng"/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><strong style="font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;text-align: start;">发起攻击后查看日志：</strong></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.24775353016688062" data-s="300,640" style="height: auto !important;" data-type="png" data-w="3116" src="https://wechat2rss.xlab.app/img-proxy/?k=4f7094c2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMKibL2lhNoPiaHDnbSicUBd1icz1fic9wcPcadichK4ruR0Dkr0ATSxG0wEQl1WKPTaWnuUJIfpwl0JEkg%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 0em;white-space: normal;text-align: left;"><span style="font-size: 15px;">攻击详情：</span></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><br/></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.27431906614785995" data-s="300,640" style="height: auto !important;" data-type="png" data-w="3084" src="https://wechat2rss.xlab.app/img-proxy/?k=16bce0f9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMKibL2lhNoPiaHDnbSicUBd1ic7JFVJEqucTBibFfwptKgIMkohMSvb5KLsRGntKlv4Be7QQ6dxtWlA4A%2F640%3Fwx_fmt%3Dpng"/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><span style="font-family: &#34;pingfang SC&#34;, &#34;helvetica neue&#34;, arial, &#34;hiragino sans gb&#34;, &#34;microsoft yahei ui&#34;, &#34;microsoft yahei&#34;, simsun, sans-serif;"></span></p><p style="white-space: normal;">调用栈：</p><p style="white-space: normal;"><br/></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.7321848081440877" data-s="300,640" style="height: auto !important;" data-type="png" data-w="2554" src="https://wechat2rss.xlab.app/img-proxy/?k=7feb22b5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMKibL2lhNoPiaHDnbSicUBd1ic8BicibOaEOuab3VyibhiaeLhN9k0mgicnxk3jzHd14IpvI3QsTicnznbibYLg%2F640%3Fwx_fmt%3Dpng"/></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"></span><br/></p><p style="margin-bottom: 0em;white-space: normal;text-align: left;"><span style="font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">业务层面影响：请求被阻断</span></p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5246753246753246" data-s="300,640" style="height: auto !important;" data-type="png" data-w="2310" src="https://wechat2rss.xlab.app/img-proxy/?k=d773d287&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYMKibL2lhNoPiaHDnbSicUBd1icPEWRGfJ4IEy9b7KnCiciahDDvpYRct5koJAhlS2Jtecc6xzYIjrK4YSQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;">    <span style="font-size: 14px;">说明：1.2.80版本的绕过问题，rasp 理论上都可以检测到，由于绕过poc构造难度大，并且没有公开的资料，这里没有复现。</span></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><br/></p><p>官网：http://www.jrasp.com<br style="outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"/></p><p style="outline: 0px;max-width: 100%;color: rgb(34, 34, 34);font-family: -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);caret-color: rgb(34, 34, 34);box-sizing: border-box !important;overflow-wrap: break-word !important;">github：https://github.com/jvm-rasp/jrasp-agent</p><p style="outline: 0px;max-width: 100%;color: rgb(34, 34, 34);font-family: -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);caret-color: rgb(34, 34, 34);box-sizing: border-box !important;overflow-wrap: break-word !important;">加入技术交流群请添加微信：<strong style="outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;">sear2022</strong></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><br/></p><p style="white-space: normal;"><br/></p><p><br/></p>




]]></content:encoded>
      <pubDate>Sun, 29 May 2022 15:22:58 +0800</pubDate>
    </item>
    <item>
      <title>Java Agent 核心技术JVM之类的热替换原理解读</title>
      <link>https://mp.weixin.qq.com/s?__biz=Mzg5MjQ1OTkwMg==&amp;mid=2247484250&amp;idx=1&amp;sn=56d1b2590ed4dfa5217a750696cbdfd4</link>
      <description>Java Agent 核心技术JVM之类的热替换原理</description>
      <content:encoded><![CDATA[<p>
<span>NPE</span> <span>2022-05-22 20:57</span> <span style="display: inline-block;">上海</span>
</p>

<p>Java Agent 核心技术JVM之类的热替换原理</p>
<p></p>



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


<h2 style="text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-top: 8px;margin-bottom: 16px;font-weight: 700;font-family: &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, SimHei, Arial, SimSun;font-size: 22px;color: rgb(79, 79, 79);line-height: 30px;word-wrap: break-word;"><span style="box-sizing: border-box;outline: 0px;word-wrap: break-word;">先讲讲怎么用吧</span></h2><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">    一上来就说原理还是不怎么合适的，先给大家讲下这个技术怎么用吧。但是这篇文章重点不是讲怎么用，所以我只讲个大概流程。</p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">第一步：写个Agent类，获取Instrumentation对象</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="cs"><code><span class="code-snippet_outer">public class MyAgent {</span></code><code><span class="code-snippet_outer">  private static Instrumentation mInstrumentation;</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">  public static void agentmain(String agentArgs, Instrumentation inst) {</span></code><code><span class="code-snippet_outer">    mInstrumentation = inst;</span></code><code><span class="code-snippet_outer">  }</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">  // 拿到Instrumentation对象后就可以利用ClassModifierTransformer来进行类的热替换了</span></code><code><span class="code-snippet_outer">  public static void modifyClass(Class clazz){</span></code><code><span class="code-snippet_outer">    ClassFileTransformer transformer = new ClassModifierTransformer();</span></code><code><span class="code-snippet_outer">    mInstrumentation.addTransformer(transformer, true);</span></code><code><span class="code-snippet_outer">    mInstrumentation.retransformClasses(new Class[]{clazz});</span></code><code><span class="code-snippet_outer">    mInstrumentation.removeTransformer(transformer);</span></code><code><span class="code-snippet_outer">  }</span></code><code><span class="code-snippet_outer">}</span></code></pre></section><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><span style="font-size: 16px;text-align: start;caret-color: rgb(77, 77, 77);color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;background-color: rgb(255, 255, 255);">第二步：写个ClassFileTransformer，利用ASM/Javassist等工具进行字节码修改</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer">public class ClassModifierTransformer implements ClassFileTransformer {</span></code><code><span class="code-snippet_outer"><br/></span></code><code><span class="code-snippet_outer">  @Override</span></code><code><span class="code-snippet_outer">  public byte[] transform(ClassLoader loader, String className, Class&lt;?&gt; classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {</span></code><code><span class="code-snippet_outer">    // 在这里利用Javassist等工具修改类的字节码，返回修改后类的字节数组</span></code><code><span class="code-snippet_outer">    return null;</span></code><code><span class="code-snippet_outer">  }</span></code><code><span class="code-snippet_outer">}</span></code></pre></section><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">    目前已经有很多文章讲具体使用方法了，大家可以搜索下，我这里先介绍两篇：<br/></p><ul style="font-size: 16px;text-align: start;white-space: normal;outline: 0px;margin-bottom: 24px;list-style: none;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;" class="list-paddingleft-1"><li style="box-sizing: border-box;outline: 0px;margin-top: 8px;margin-left: 32px;list-style: disc;word-wrap: break-word;"><p>基于Java Instrument的Agent实现</p></li><li style="box-sizing: border-box;outline: 0px;margin-top: 8px;margin-left: 32px;list-style: disc;word-wrap: break-word;"><p>谈谈Java Intrumentation和相关应用</p></li></ul><h1 style="text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-top: 8px;margin-bottom: 16px;font-weight: 700;font-family: &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, SimHei, Arial, SimSun;font-size: 24px;color: rgb(79, 79, 79);line-height: 32px;word-wrap: break-word;"><span style="box-sizing: border-box;outline: 0px;word-wrap: break-word;">原理探究</span></h1><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">热替换的核心就在于Instrumentation的两个方法：</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer"> void addTransformer(ClassFileTransformer transformer, boolean canRetransform);</span></code><code><span class="code-snippet_outer"> void retransformClasses(Class&lt;?&gt;... classes) throws UnmodifiableClassException;</span></code></pre></section><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">    addTransformer 用来注册类的修改器；retransformClasses 会让类重新加载，从而使得注册的类修改器能够重新修改类的字节码。</p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">下面让我们重点讲讲这两个方法的实现：</p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><span style="font-size: 16px;text-align: start;caret-color: rgb(77, 77, 77);color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;background-color: rgb(255, 255, 255);">1. </span><strong><span style="background-color: rgb(255, 255, 255);">addTransformer</span></strong></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5835189309576837" data-s="300,640" style="" data-type="png" data-w="2245" src="https://wechat2rss.xlab.app/img-proxy/?k=f3433a13&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgW6J7SY44ruAJUMBvIN4195GhLu9DnZoP46f6O19ibrguDPoNhMAibOq4RCo20aibM770YRyWBvNiaQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><span style="background-color: rgb(255, 255, 255);">      可见我们自己的实现的 ClassFileTransformer 被添加到了 TransformerManager中，让我们跟进去看看:</span><br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.3311081441922563" data-s="300,640" style="" data-type="png" data-w="2247" src="https://wechat2rss.xlab.app/img-proxy/?k=11a92703&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgW6J7SY44ruAJUMBvIN41XWdGicUahUNYsJj8Pn4JgDTP3MOxcWC08DI89icKlPTelAru6FrGImRg%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">     ClassFileTransformer对象这次被放入了TransformerManager的一个数组中。    OK，注册完毕，很简单对不对？下面我们再来看下稍微复杂点的retransformClasses 吧。</p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">2.<span style="font-size: 16px;text-align: start;box-sizing: border-box;outline: 0px;font-weight: 700;word-wrap: break-word;caret-color: rgb(77, 77, 77);color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;">retransformClasses</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.29808121374386437" data-s="300,640" style="" data-type="png" data-w="2241" src="https://wechat2rss.xlab.app/img-proxy/?k=31daf8d5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgW6J7SY44ruAJUMBvIN41ickwJicpHIKRA87Jgk9YoxicYbODR67WSBsET41liaQfwAbAAlQ7q25UYQ%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><span style="font-size: 16px;text-align: start;caret-color: rgb(77, 77, 77);color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;background-color: rgb(255, 255, 255);">    这个方法的实现最终调用的是个Native方法。<span style="font-size: 16px;text-align: start;caret-color: rgb(77, 77, 77);color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;background-color: rgb(255, 255, 255);">很多同学看到Native方法就头疼，不要急，Native方法也是人写的，不过是一段文本而已。我们来看下具体实现吧：</span></span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.22296994167788245" data-s="300,640" style="" data-type="png" data-w="2229" src="https://wechat2rss.xlab.app/img-proxy/?k=0d812666&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgW6J7SY44ruAJUMBvIN41VY0bILhbSibSu8XVNhHxA8DVlPPpCILIKibC3iasUAZpyNPFX56JlrICw%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;">继续跟进 --&gt;</p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.0977760736196319" data-s="300,640" style="text-align: center;white-space: normal;" data-type="png" data-w="2608" src="https://wechat2rss.xlab.app/img-proxy/?k=b597bcd2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYNgW6J7SY44ruAJUMBvIN41ZcCXAC6iaKpQFesH0VaV1k88SrYBZ8ibribI6sxFM4FG9qm7Unm8XWOrg%2F640%3Fwx_fmt%3Dpng"/></p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><span style="background-color: rgb(255, 255, 255);">retransformClasses 最后会调用到 jvmtiEnv.cpp中的 RetransformClasses</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.7869127516778524" data-s="300,640" style="" data-type="png" data-w="2384" src="https://wechat2rss.xlab.app/img-proxy/?k=f0a3b807&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONH9qjjVkgzGoG9pvIxQibVO90cvSxNDTp1PRqN3iaU6Z7JapiaiaLlFsAt4Q%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5632858340318525" data-s="300,640" style="" data-type="png" data-w="2386" src="https://wechat2rss.xlab.app/img-proxy/?k=64f4b560&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHtUZ0IEOGACuib6DoWuZACMQZ4v5AEEFdNNibNYUJia0Bde6W10lnkumow%2F640%3Fwx_fmt%3Dpng"/><br/></p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><span style="color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;text-align: justify;font-size: 14px;">补充：Klass是一个抽象基类，它定义了一些接口（纯虚函数），由 InstanceKlass 继承并实现，两者结合可以描述一个java类的方法、字段、父类等信息。InstanceKlass 在jvm层面可以描述绝大部分java类。</span></p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><span style="color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-align: justify;">上面这段代码主要干了两件事：</span></p><p style="font-size: 16px;text-align: start;white-space: normal;box-sizing: border-box;outline: 0px;margin-bottom: 16px;color: rgb(77, 77, 77);overflow: auto hidden;word-wrap: break-word;font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;line-height: 26px !important;"><span style="color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;text-align: justify;">(1) 根据 java 层的Class对象，找到JVM层的类实例 InstanceKlass，并获取类的字节码，存放在class_definitions数组中。因为可以一次替换多个类，所以这里加了一个循环体，遍历每个要修改的类。</span><br/></p><p>(2) 调用VMThread::execute(&amp;op)</p><p style="white-space: normal;"><span style="caret-color: rgb(33, 37, 41);color: rgb(33, 37, 41);font-family: Helvetica, Verdana, Arial, sans-serif;font-size: 16px;text-align: left;background-color: rgb(255, 255, 255);">    在获取了类的字节码之后，创建了一个 VM_RedefineClasses 的 vmop，然后通知VMThread进行处理。</span></p><p>    在分析代码之前，先来看下比较重要的 <span style="color: rgb(255, 0, 0);">VM_Operation</span><span style="color: rgb(0, 0, 0);">。</span>VM_Operation 是虚拟机级别的操作，这些操作包含了所有JVM的内置操作，例如GC、获取线程栈等等。这个类是所有这些操作的基类，该类定义在hotspot/src/share/vm/runtime/vmOperations.hpp 。</p><p>    首先，该类定义了 Mode 和 VMOp_Type 两个枚举。第一个表示该操作的模式，第二个表示该操作的类型。事实上所有的类型都在文件开头的宏定义中写明了，这里我们只关心 RedefineClasses 这个类型。Mode包括这四种：</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.2893401015228426" data-s="300,640" style="" data-type="png" data-w="2364" src="https://wechat2rss.xlab.app/img-proxy/?k=19d8d608&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHT7rZVouXvzTVdA7No3rpcRkpMO8ULdiafJ7KqUM1G1NENR0KrT6HmcA%2F640%3Fwx_fmt%3Dpng"/></p><p><span style="caret-color: rgb(33, 37, 41);color: rgb(33, 37, 41);font-family: Helvetica, Verdana, Arial, sans-serif;font-size: 16px;text-align: left;background-color: rgb(255, 255, 255);"> 再来看下 </span>VM_RedefineClasses<br/></p><p>    VM_RedefineClasses是VM_Operation的子类，实现了类转换的所有逻辑。该类定义和实现分别在hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp和hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp。</p><p>    对于一个VM_Operation的子类，首先需要关心 evaluation_mode 函数。VM_RedefineClasses 类中找不到该函数，因此它是一个需要在 safepoint 阻塞的操作。</p><p>    然后就是核心操作，即 doit_prologue、doit、doit_epilogue。代码比较复杂，本节先介绍doit_prologue的实现。我们先从注释上了解每个步骤做了什么</p><p>1.doit_prologue</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.324545116969922" data-s="300,640" style="" data-type="png" data-w="2693" src="https://wechat2rss.xlab.app/img-proxy/?k=926dae4d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHd4iaEqJn3wQAP7W1XaoOfoiaJRicpdFwFb36gibGp84m0HBUMslrvbVJZA%2F640%3Fwx_fmt%3Dpng"/></p><p>    在 doit_prologue 阶段，整个操作都是在Java线程中进行的，因此不会阻塞VMThread，也不会被计入safepoint的耗时。注意整个源码中<strong><span style="color: rgb(255, 0, 0);"> the_class</span></strong> 表示待替换的类，<span style="color: rgb(255, 0, 0);"><strong>scratch_class</strong></span>表示新的类。</p><pre style="transition-duration: 0.2s;transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;padding-left: 35px;text-align: left;color: rgb(0, 0, 0);caret-color: rgb(0, 0, 0);overflow: visible !important;border-top-left-radius: 0px !important;border-top-right-radius: 0px !important;border-bottom-right-radius: 0px !important;border-bottom-left-radius: 0px !important;background-image: none !important;border: 0px !important;inset: auto !important;height: auto !important;line-height: 1.8em !important;outline: 0px !important;vertical-align: baseline !important;width: auto !important;box-sizing: content-box !important;font-family: Consolas, &#34;Bitstream Vera Sans Mono&#34;, &#34;Courier New&#34;, Courier, monospace !important;font-size: 12px !important;min-height: auto !important;"></pre><p>    该阶段主要做的就是准备需要的字节码，包括解析字节码、类的链接、常量池合并、字节码校验等步骤。需要说明的是，如果业务代码中准备新的字节码时间比较长（前面提到的获取新字节码的回调也是在这里发生），这个阶段时间就会变长，但是不会阻塞JVM的核心线程。</p><p>    然后，我们看下这部分是如何实现的<br/></p><p style="white-space: normal;text-align: left;">   VMThread::execute(&amp;op) 中会调用到 VM_RedefineClasses::doit_prologue，核心逻辑在 VM_RedefineClasses::load_new_class_versions()</p><p style="white-space: normal;text-align: left;">由于代码较长，分为多个部分，第一部分如下</p><p style="margin-bottom: 0em;white-space: normal;text-align: center;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.730045967404931" data-s="300,640" data-w="2393" data-type="png" src="https://wechat2rss.xlab.app/img-proxy/?k=9bd7165f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHdXN4FM3ibjQvWwz1Ufo7ibKurLMoERTdD6jhg2UV69gPYszvs7m2yk4A%2F640%3Fwx_fmt%3Dpng"/><br/></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.48582151793160966" data-s="300,640" style="" data-type="png" data-w="2398" src="https://wechat2rss.xlab.app/img-proxy/?k=c035141f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHrFicPLibUXL6YnMuicAE1t0R9RX3Ficq8ghpvrACvGGwGxdLOej7Vj3dpA%2F640%3Fwx_fmt%3Dpng"/></p><p style="white-space: normal;"><span style="color: rgb(0, 0, 0);">parse_stream() </span><span style="color: rgb(0, 0, 0);">这里又调用了KlassFactory::</span><span style="color: rgb(0, 0, 0);">check_class_file_load_hook</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.8054443554843875" data-s="300,640" style="" data-type="png" data-w="2498" src="https://wechat2rss.xlab.app/img-proxy/?k=ce19580c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHVZBciaVXMBpsUqMjSjp0LiarB8U7SCNvHOFjOZTia56lpFzCjNJciaz0rQ%2F640%3Fwx_fmt%3Dpng"/></p><p>    看名字就知道是个hook方法，它会调用post_class_file_load_hook。</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.4628428927680798" data-s="300,640" style="" data-type="png" data-w="2005" src="https://wechat2rss.xlab.app/img-proxy/?k=a79fdf25&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHgpgic4Ily3Eup8W9IInkzll39xckMRIiaibM9Yic3Pullzp8GyuQTx3BRw%2F640%3Fwx_fmt%3Dpng"/></p><p>    利用JvmtiClassFileLoadHookPoster来通知类修改器进行类的修改。进入 poster.post() 里面</p><p style="text-align: left;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.6865738661876964" data-s="300,640" style="" data-type="png" data-w="2227" src="https://wechat2rss.xlab.app/img-proxy/?k=4086ef9c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHqkzaHEOWmrRpfIGb13HnsnkrRHXXYaBzdcuHjp8rFy9PzNqbTyJC1w%2F640%3Fwx_fmt%3Dpng"/>消息发给所有的<span style="text-align: justify;"> jvmtienv , 最终的调用如下：</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.7286112216474333" data-s="300,640" style="" data-type="png" data-w="2513" src="https://wechat2rss.xlab.app/img-proxy/?k=01100338&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONH8uap8eouUuxPZJoiax6d4V7w254R1488h89NwaG8mWXhcnkBq6dnZAg%2F640%3Fwx_fmt%3Dpng"/></p><p>实际的消息处理者：</p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.6196" data-s="300,640" style="" data-type="png" data-w="2500" src="https://wechat2rss.xlab.app/img-proxy/?k=47a93427&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHic3NUKlLI7oUGiacklagQaBu8zQGp4XfnoVwh5ONxMjAHON4xjjRn12w%2F640%3Fwx_fmt%3Dpng"/></p><p>  <span style="font-size: 16px;text-align: start;caret-color: rgb(77, 77, 77);color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;background-color: rgb(255, 255, 255);">eventHandlerClassFileLoadHook在收到消息后，会调用transformClassFile </span></p><p style="text-align: start;"><span style="color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;font-size: 16px;caret-color: rgb(77, 77, 77);background-color: rgb(255, 255, 255);">,继续跟进---&gt;</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.5411013567438149" data-s="300,640" style="" data-type="png" data-w="2506" src="https://wechat2rss.xlab.app/img-proxy/?k=702b2ef8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHyCJpZcDiaj7oxUupaMfoRKofWdCmPriaHx0ibjgwfzuXbPTEiaHMTs4icEA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: start;"><span style="font-size: 16px;text-align: start;caret-color: rgb(77, 77, 77);color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;background-color: rgb(255, 255, 255);">    这里会利用JNI调用 java 层InstrumentationImpl的transform，你看，我们又绕到Java层了。</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.7240127099409895" data-s="300,640" style="" data-type="png" data-w="2203" src="https://wechat2rss.xlab.app/img-proxy/?k=cd3efa98&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHN3E8X3dicwcARibicwSxdumPSC8W8QYr9xpa7ibqow04Wsib5rdFZd42tgA%2F640%3Fwx_fmt%3Dpng"/></p><p style="text-align: start;"><span style="font-size: 16px;text-align: start;caret-color: rgb(77, 77, 77);color: rgb(77, 77, 77);font-family: -apple-system, &#34;SF UI Text&#34;, Arial, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif, SimHei, SimSun;background-color: rgb(255, 255, 255);">    </span><span style="color: rgb(0, 0, 0);text-align: justify;">transform 方法的调用如下：</span></p><p style="text-align: center;margin-bottom: 0em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="0.8165680473372781" data-s="300,640" style="" data-type="png" data-w="2535" src="https://wechat2rss.xlab.app/img-proxy/?k=e2867872&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FUMb7JCCdbYOw86B7XvPf6w6BRRHYxONHXWfNLMMkMxWMSSz5L0xXRyxEO16oh1ZLeeQRN70eu5Hv3uxkwQW5UQ%2F640%3Fwx_fmt%3Dpng"/><br/></p><p style="text-align: start;"><br/></p><p>    看到这儿，大家还记得我们开始的时候，会将我们自定义的ClassFileTransformer对象注册到TransformerManager中吗？这里终于派上用场了，TransformerManager的transform（）方法会遍历它的注册数组，调用每个ClassFileTransformer对象的transform（）方法，并将我们修改后的类字节码返回，返回后的字节码最终又回到了上面JVM层的transformClassFile（）中，并最终交还给给class_file_load_hook 消息的发送方。</p><p><br/></p><p style="text-align: start;"><br/></p>



<p><a href="2247484250">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=f0957b45&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzg5MjQ1OTkwMg%3D%3D%26mid%3D2247484250%26idx%3D1%26sn%3D56d1b2590ed4dfa5217a750696cbdfd4%26subscene%3D0">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sun, 22 May 2022 20:57:00 +0800</pubDate>
    </item>
  </channel>
</rss>