<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2018-20250_WinRAR%E7%9B%AE%E9%8C%84%E7%A9%BF%E8%B6%8A%E6%BC%8F%E6%B4%9E</id>
	<title>CVE-2018-20250 WinRAR目錄穿越漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2018-20250_WinRAR%E7%9B%AE%E9%8C%84%E7%A9%BF%E8%B6%8A%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2018-20250_WinRAR%E7%9B%AE%E9%8C%84%E7%A9%BF%E8%B6%8A%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-09T02:21:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=CVE-2018-20250_WinRAR%E7%9B%AE%E9%8C%84%E7%A9%BF%E8%B6%8A%E6%BC%8F%E6%B4%9E&amp;diff=1986&amp;oldid=prev</id>
		<title>Pwnwiki: /* 漏洞利用 */</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2018-20250_WinRAR%E7%9B%AE%E9%8C%84%E7%A9%BF%E8%B6%8A%E6%BC%8F%E6%B4%9E&amp;diff=1986&amp;oldid=prev"/>
		<updated>2021-05-01T01:52:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;漏洞利用&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;chinese&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:52, 1 May 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l69&quot; &gt;Line 69:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 69:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;修改完成，將文件另存為1.rar。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;修改完成，將文件另存為1.rar。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:1266243-20190308155112326-854060047&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.png&lt;/del&gt;.png |600px]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:1266243-20190308155112326-854060047.png |600px]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;選擇解壓到當前文件夾或解壓到文件夾1都可以，可以看到bat文件成功解壓到開機啟動項裡。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;選擇解壓到當前文件夾或解壓到文件夾1都可以，可以看到bat文件成功解壓到開機啟動項裡。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key pwn_wiki:diff::1.12:old-1985:rev-1986 --&gt;
&lt;/table&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
	<entry>
		<id>https://pwnwiki.com/index.php?title=CVE-2018-20250_WinRAR%E7%9B%AE%E9%8C%84%E7%A9%BF%E8%B6%8A%E6%BC%8F%E6%B4%9E&amp;diff=1985&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;==漏洞原理== 該漏洞是由於WinRAR 所使用的一個陳舊的動態鏈接庫UNACEV2.dll所造成的，該動態鏈接庫在2006 年被編譯，沒有任何的基礎保...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2018-20250_WinRAR%E7%9B%AE%E9%8C%84%E7%A9%BF%E8%B6%8A%E6%BC%8F%E6%B4%9E&amp;diff=1985&amp;oldid=prev"/>
		<updated>2021-05-01T01:51:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==漏洞原理== 該漏洞是由於WinRAR 所使用的一個陳舊的動態鏈接庫UNACEV2.dll所造成的，該動態鏈接庫在2006 年被編譯，沒有任何的基礎保...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==漏洞原理==&lt;br /&gt;
該漏洞是由於WinRAR 所使用的一個陳舊的動態鏈接庫UNACEV2.dll所造成的，該動態鏈接庫在2006 年被編譯，沒有任何的基礎保護機制(ASLR,DEP 等)。該動態鏈接庫的作用是處理ACE 格式文件。而在解壓處理過程中存在一處目錄穿越漏洞,允許解壓過程寫入文件至開機啟動項，導致代碼執行。&lt;br /&gt;
&lt;br /&gt;
==漏洞影響==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WinRAR &amp;lt; 5.70 Beta 1&lt;br /&gt;
&lt;br /&gt;
Bandizip &amp;lt; = 6.2.0.0&lt;br /&gt;
&lt;br /&gt;
好壓(2345壓縮) &amp;lt; = 5.9.8.10907&lt;br /&gt;
&lt;br /&gt;
360壓縮 &amp;lt; = 4.0.0.1170&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==利用條件==&lt;br /&gt;
攻擊不能跨盤符，即受害者進行解壓文件觸發漏洞時，必須在系統盤，且在不知道計算機主機名的情況下，只能在主瀏覽器的默認下載路徑下（C:\Users\Administrator \Downloads）或者桌面進行解壓，或者多猜幾個啟動項路徑。產生漏洞的DLL文件：UNACEV2.DLL，不能識別相對路徑，文件名部分必須為絕對路徑。&lt;br /&gt;
&lt;br /&gt;
以下是幾種機器的開機啟動項路徑，可以看到在個人PC上受用戶名影響，無法猜測到準確的路徑，而服務器上一般不會修改用戶名，所以這個漏洞在服務器上利用度比較高。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==漏洞利用==&lt;br /&gt;
這裡我們寫一個bat，進行彈窗演示：&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190308101249378-2013483925.png |600px]]&lt;br /&gt;
&lt;br /&gt;
然後打開WinAce，選中我們創建的文件，右鍵，點擊Add to...&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190308124414993-1147235497.png |600px]]&lt;br /&gt;
&lt;br /&gt;
利用WinACE進行壓縮,這裡選擇store full path&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190308144027681-585501340.png |600px]]&lt;br /&gt;
&lt;br /&gt;
生成之後我們利用腳本檢查一下我們生成的文件1.ace的header信息：&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190308133050691-1223667359.png |600px]]&lt;br /&gt;
&lt;br /&gt;
這裡幾個是我們需要修改的參數。&lt;br /&gt;
&lt;br /&gt;
在010Edit工具中打開剛才生成的1.ace文件，將文件路徑替換為啟動項路徑如下，然後可以看到新的完整的文件路徑長度為93，轉換為16進制後為：5D。&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190310222141566-376777695.png |600px]]&lt;br /&gt;
&lt;br /&gt;
修改完这两个地方之后点击保存，接着还需要修改hdr_size&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190310222410019-46466160.png |600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190310222513809-688780836.png |600px]]&lt;br /&gt;
&lt;br /&gt;
這三個地方修改完成之後點擊保存。&lt;br /&gt;
&lt;br /&gt;
最後利用acefile.py重新查看文件header信息。修改acefile.py，在3061行處添加以下語句，輸出文件hdr_crc。&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190308150606052-328146804.png |600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
print(&amp;quot;[+] right_hdr_crc : {} | struct {} &amp;quot;.format(hex(ace_crc16(buf)),struct.pack('&amp;lt;H', ace_crc16(buf))))&lt;br /&gt;
print(&amp;quot;[*] current_hdr_crc : {} | struct {}&amp;quot;.format(hex(hcrc),struct.pack('&amp;lt;H', hcrc)))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190310222732970-1725311033.png |600px]]&lt;br /&gt;
&lt;br /&gt;
可以看到当前的hdr_crc为：16 9A，我们要把它改为E4 A3，保存之后重新查看文件header信息。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190310222933918-1700514051.png |600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
修改完成，將文件另存為1.rar。&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190308155112326-854060047.png.png |600px]]&lt;br /&gt;
&lt;br /&gt;
選擇解壓到當前文件夾或解壓到文件夾1都可以，可以看到bat文件成功解壓到開機啟動項裡。&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190309111018388-35896760.png |600px]]&lt;br /&gt;
&lt;br /&gt;
重啟電腦查看效果&lt;br /&gt;
&lt;br /&gt;
[[File:1266243-20190309112143784-391653487.png |600px]]&lt;br /&gt;
&lt;br /&gt;
复现成功，自动运行bat文件弹窗。&lt;br /&gt;
&lt;br /&gt;
==EXP&amp;amp;POC==&lt;br /&gt;
https://github.com/WyAtu/CVE-2018-20250&lt;br /&gt;
&lt;br /&gt;
https://github.com/QAX-A-Team/CVE-2018-20250&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==參考==&lt;br /&gt;
https://wiki.bylibrary.cn/%E6%BC%8F%E6%B4%9E%E5%BA%93/03-%E4%BA%A7%E5%93%81%E6%BC%8F%E6%B4%9E/winrar/WinRAR%E7%A9%BF%E9%80%8F%E6%BC%8F%E6%B4%9E%EF%BC%88CVE-2018-20250%EF%BC%89/&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>